refactor: remove Temp

This was a very old way of migrating the history and is no longer needed.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares
2026-06-22 23:06:17 +02:00
committed by Philip Molares
parent 3f50054609
commit 0749c31100
5 changed files with 19 additions and 123 deletions

View File

@@ -61,7 +61,6 @@ const options = {
}
const historyList = new List('history', options)
window.migrateHistoryFromTempCallback = pageInit
setloginStateChangeEvent(pageInit)
pageInit()

View File

@@ -3,7 +3,6 @@
import store from 'store'
import LZString from 'lz-string'
import url from 'wurl'
import {
checkNoteIdValid,
@@ -19,40 +18,6 @@ import {
urlpath
} from './lib/config'
window.migrateHistoryFromTempCallback = null
migrateHistoryFromTemp()
function migrateHistoryFromTemp () {
if (url('#tempid')) {
$.get(`${serverurl}/temp`, {
tempid: url('#tempid')
})
.done(data => {
if (data && data.temp) {
getStorageHistory(olddata => {
if (!olddata || olddata.length === 0) {
saveHistoryToStorage(JSON.parse(data.temp))
}
})
}
})
.always(() => {
let hash = location.hash.split('#')[1]
hash = hash.split('&')
for (let i = 0; i < hash.length; i++) {
if (hash[i].indexOf('tempid') === 0) {
hash.splice(i, 1)
i--
}
}
hash = hash.join('&')
location.hash = hash
if (window.migrateHistoryFromTempCallback) { window.migrateHistoryFromTempCallback() }
})
}
}
export function saveHistory (notehistory) {
checkIfAuth(
() => {