Initial commit
This commit is contained in:
22
ui/home_historyctl.js
Normal file
22
ui/home_historyctl.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { History } from "./commands/history.js";
|
||||
|
||||
export function build(ctx) {
|
||||
let rec = JSON.parse(localStorage.getItem("knowns"));
|
||||
|
||||
if (!rec) {
|
||||
rec = [];
|
||||
}
|
||||
|
||||
return new History(
|
||||
rec,
|
||||
(h, d) => {
|
||||
try {
|
||||
localStorage.setItem("knowns", JSON.stringify(d));
|
||||
ctx.connector.knowns = h.all();
|
||||
} catch (e) {
|
||||
alert("Unable to save remote history due to error: " + e);
|
||||
}
|
||||
},
|
||||
32
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user