Mercurial > hg > forks > multipaint-js
changeset 106:3abfab85e7bc
Change it so that each "machine type" uses separate local storage variable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Jul 2018 06:22:10 +0300 |
parents | 6429d0b757cd |
children | 0d0b384bac0f |
files | events.pde |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/events.pde Fri Jul 06 06:14:27 2018 +0300 +++ b/events.pde Fri Jul 06 06:22:10 2018 +0300 @@ -843,21 +843,21 @@ if (fdata != null) { var fstr = JSON.stringify(fdata); - localStorage.setItem("MPIMAGE_DATA", fstr); + localStorage.setItem("MPIMAGE_DATA"+ str(machine), fstr); message("Saved to lstorage"); } else message("ERROR"); } else - message("Lstorage/save|not available"); + message("Lstorage is not available"); } if (g_data[int('L')] == 1) { g_data[int('L')] = 0; if (mpHaveLocalStorage()) { - var fstr = localStorage.getItem("MPIMAGE_DATA"); + var fstr = localStorage.getItem("MPIMAGE_DATA"+ str(machine)); if (fstr != null && typeof(fstr) == "string") { var fdata = JSON.parse(fstr); @@ -877,6 +877,6 @@ message("No data in lstorage"); } else - message("Lstorage/load|not available"); + message("Lstorage is not available"); } }