Rename localStorage item knowns to sshwifty-knowns
This commit is contained in:
@@ -3,8 +3,21 @@ import { History } from "./commands/history.js";
|
||||
export function build(ctx) {
|
||||
let rec = [];
|
||||
|
||||
// This renames "knowns" to "sshwifty-knowns"
|
||||
// TODO: Remove this after some few years
|
||||
try {
|
||||
rec = JSON.parse(localStorage.getItem("knowns"));
|
||||
let oldStore = localStorage.getItem("knowns");
|
||||
|
||||
if (oldStore) {
|
||||
localStorage.setItem("sshwifty-knowns", oldStore);
|
||||
localStorage.removeItem("knowns");
|
||||
}
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
try {
|
||||
rec = JSON.parse(localStorage.getItem("sshwifty-knowns"));
|
||||
|
||||
if (!rec) {
|
||||
rec = [];
|
||||
@@ -17,7 +30,7 @@ export function build(ctx) {
|
||||
rec,
|
||||
(h, d) => {
|
||||
try {
|
||||
localStorage.setItem("knowns", JSON.stringify(d));
|
||||
localStorage.setItem("sshwifty-knowns", JSON.stringify(d));
|
||||
ctx.connector.knowns = h.all();
|
||||
} catch (e) {
|
||||
alert("Unable to save remote history due to error: " + e);
|
||||
|
||||
Reference in New Issue
Block a user