Compare commits
No commits in common. "1038602d5b066ad64fcae3c2c3d156725c085f34" and "d5a67c919873454a3672f7dd0cf5e2b723cbaf89" have entirely different histories.
1038602d5b
...
d5a67c9198
@ -32,11 +32,6 @@
|
|||||||
let DisplayComments: Comment[];
|
let DisplayComments: Comment[];
|
||||||
let commentPage = 0;
|
let commentPage = 0;
|
||||||
let pageSize = 10;
|
let pageSize = 10;
|
||||||
|
|
||||||
const escapeHtml = (unsafe) => {
|
|
||||||
return unsafe.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onSubmit(event: SubmitEvent) {
|
async function onSubmit(event: SubmitEvent) {
|
||||||
// Validation
|
// Validation
|
||||||
if (name === '' || message === '') {
|
if (name === '' || message === '') {
|
||||||
@ -91,7 +86,7 @@
|
|||||||
// Check if in localstorage already
|
// Check if in localstorage already
|
||||||
let commentLS = localStorage.getItem('comments');
|
let commentLS = localStorage.getItem('comments');
|
||||||
let comments: Comment[];
|
let comments: Comment[];
|
||||||
if (commentLS == null) {
|
if (commentLS === null) {
|
||||||
// Not yet in storage
|
// Not yet in storage
|
||||||
comments = await updateComments();
|
comments = await updateComments();
|
||||||
DisplayComments = comments;
|
DisplayComments = comments;
|
||||||
@ -104,7 +99,7 @@
|
|||||||
return t;
|
return t;
|
||||||
});
|
});
|
||||||
let oldHash = localStorage.getItem('commenthash');
|
let oldHash = localStorage.getItem('commenthash');
|
||||||
if (oldHash?.trim() !== newHash.trim()) {
|
if (oldHash != newHash) {
|
||||||
DisplayComments = await updateComments();
|
DisplayComments = await updateComments();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user