Do not save/load image_data to localStorage

This commit is contained in:
M. Yusuf Sarıgöz 2023-10-22 19:08:09 +03:00
parent f67d971344
commit 5359fb9267
2 changed files with 2117 additions and 2101 deletions

File diff suppressed because it is too large Load diff

View file

@ -125,6 +125,7 @@
background-color: #222; background-color: #222;
color: #ddd; color: #ddd;
} }
code { code {
font-family: monospace; font-family: monospace;
padding: 0.1em 0.3em; padding: 0.1em 0.3em;
@ -141,7 +142,8 @@
display: inline; display: inline;
} }
header, footer { header,
footer {
text-align: center; text-align: center;
} }
@ -163,6 +165,7 @@
0% { 0% {
background-position: 0%; background-position: 0%;
} }
100% { 100% {
background-position: 100%; background-position: 100%;
} }
@ -181,6 +184,7 @@
--loading-color-1: #22222200; --loading-color-1: #22222200;
--loading-color-2: #222222ff; --loading-color-2: #222222ff;
} }
.popover-content { .popover-content {
background-color: black; background-color: black;
} }
@ -275,6 +279,7 @@
// saved templates were successfuly imported. // saved templates were successfuly imported.
console.log('Processing saved templates and updating default template') console.log('Processing saved templates and updating default template')
params.value = { ...params.value, image_data: [] };
//console.log(importedTemplates); //console.log(importedTemplates);
savedUserTemplates.value = importedTemplates; savedUserTemplates.value = importedTemplates;
@ -301,6 +306,7 @@
session.value = t.data.session; session.value = t.data.session;
session.value = { ...session.value, image_selected: '' }; session.value = { ...session.value, image_selected: '' };
params.value = t.data.params; params.value = t.data.params;
params.value = { ...params.value, image_data: [] };
} }
function userTemplateResetToDefaultAndApply() { function userTemplateResetToDefaultAndApply() {
@ -491,8 +497,10 @@
reader.onload = function () { reader.onload = function () {
const image_data = reader.result; const image_data = reader.result;
session.value = { ...session.value, image_selected: image_data }; session.value = { ...session.value, image_selected: image_data };
params.value = {...params.value, image_data: [ params.value = {
{ data: image_data.replace(/data:image\/[^;]+;base64,/, ''), id: 10 }] } ...params.value, image_data: [
{ data: image_data.replace(/data:image\/[^;]+;base64,/, ''), id: 10 }]
}
}; };
selected_image = true; selected_image = true;
reader.readAsDataURL(selectedFile); reader.readAsDataURL(selectedFile);
@ -988,7 +996,8 @@
<body> <body>
<div id="container"> <div id="container">
<input type="file" id="fileInput" accept="image/*" style="display: none;"></div> <input type="file" id="fileInput" accept="image/*" style="display: none;">
</div>
<div id="portal"></div> <div id="portal"></div>
</body> </body>