Fix hashing
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
75f3777b46
commit
1038602d5b
|
@ -32,6 +32,11 @@
|
||||||
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 === '') {
|
||||||
|
@ -86,7 +91,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;
|
||||||
|
@ -99,7 +104,7 @@
|
||||||
return t;
|
return t;
|
||||||
});
|
});
|
||||||
let oldHash = localStorage.getItem('commenthash');
|
let oldHash = localStorage.getItem('commenthash');
|
||||||
if (oldHash != newHash) {
|
if (oldHash?.trim() !== newHash.trim()) {
|
||||||
DisplayComments = await updateComments();
|
DisplayComments = await updateComments();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue