Rename local storage key variable
parent
7d9e37c02d
commit
8ea4743f7f
|
@ -121,7 +121,6 @@
|
||||||
"lors",
|
"lors",
|
||||||
"Lospec",
|
"Lospec",
|
||||||
"lrgb",
|
"lrgb",
|
||||||
"lsid",
|
|
||||||
"ltres",
|
"ltres",
|
||||||
"Luciferi",
|
"Luciferi",
|
||||||
"Macromedia",
|
"Macromedia",
|
||||||
|
|
|
@ -96,16 +96,16 @@
|
||||||
class LocalSession {
|
class LocalSession {
|
||||||
constructor(session_id) {
|
constructor(session_id) {
|
||||||
this.id = session_id;
|
this.id = session_id;
|
||||||
const lsid = `image#${session_id}`;
|
const ls_key = `image#${session_id}`;
|
||||||
log(`Local storage ID: ${lsid}`);
|
log(`Local storage key: ${ls_key}`);
|
||||||
// save image to storage
|
// save image to storage
|
||||||
this.save_image_to_storage_immediately = () => {
|
this.save_image_to_storage_immediately = () => {
|
||||||
const save_paused = handle_data_loss();
|
const save_paused = handle_data_loss();
|
||||||
if (save_paused) {
|
if (save_paused) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log(`Saving image to storage: ${lsid}`);
|
log(`Saving image to storage: ${ls_key}`);
|
||||||
storage.set(lsid, main_canvas.toDataURL("image/png"), err => {
|
storage.set(ls_key, main_canvas.toDataURL("image/png"), err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.quotaExceeded) {
|
if (err.quotaExceeded) {
|
||||||
storage_quota_exceeded();
|
storage_quota_exceeded();
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
this.save_image_to_storage_soon = debounce(this.save_image_to_storage_immediately, 100);
|
this.save_image_to_storage_soon = debounce(this.save_image_to_storage_immediately, 100);
|
||||||
storage.get(lsid, (err, uri) => {
|
storage.get(ls_key, (err, uri) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (localStorageAvailable) {
|
if (localStorageAvailable) {
|
||||||
show_error_message("Failed to retrieve image from local storage.", err);
|
show_error_message("Failed to retrieve image from local storage.", err);
|
||||||
|
|
Loading…
Reference in New Issue