remove import session button as it's not supported anymore
This commit is contained in:
parent
68a6113c26
commit
3ef37c15c7
1 changed files with 0 additions and 28 deletions
|
@ -19,30 +19,6 @@ import {TemplateView} from "../general/TemplateView";
|
||||||
import {hydrogenGithubLink} from "./common.js";
|
import {hydrogenGithubLink} from "./common.js";
|
||||||
import {SessionLoadStatusView} from "./SessionLoadStatusView.js";
|
import {SessionLoadStatusView} from "./SessionLoadStatusView.js";
|
||||||
|
|
||||||
function selectFileAsText(mimeType) {
|
|
||||||
const input = document.createElement("input");
|
|
||||||
input.setAttribute("type", "file");
|
|
||||||
if (mimeType) {
|
|
||||||
input.setAttribute("accept", mimeType);
|
|
||||||
}
|
|
||||||
const promise = new Promise((resolve, reject) => {
|
|
||||||
const checkFile = () => {
|
|
||||||
input.removeEventListener("change", checkFile, true);
|
|
||||||
const file = input.files[0];
|
|
||||||
if (file) {
|
|
||||||
resolve(file.text());
|
|
||||||
} else {
|
|
||||||
reject(new Error("No file selected"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
input.addEventListener("change", checkFile, true);
|
|
||||||
});
|
|
||||||
input.click();
|
|
||||||
return promise;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionPickerItemView extends TemplateView {
|
class SessionPickerItemView extends TemplateView {
|
||||||
_onDeleteClick() {
|
_onDeleteClick() {
|
||||||
if (confirm("Are you sure?")) {
|
if (confirm("Are you sure?")) {
|
||||||
|
@ -81,10 +57,6 @@ export class SessionPickerView extends TemplateView {
|
||||||
t.h1(["Continue as …"]),
|
t.h1(["Continue as …"]),
|
||||||
t.view(sessionList),
|
t.view(sessionList),
|
||||||
t.div({className: "button-row"}, [
|
t.div({className: "button-row"}, [
|
||||||
t.button({
|
|
||||||
className: "button-action secondary",
|
|
||||||
onClick: async () => vm.import(await selectFileAsText("application/json"))
|
|
||||||
}, vm.i18n`Import a session`),
|
|
||||||
t.a({
|
t.a({
|
||||||
className: "button-action primary",
|
className: "button-action primary",
|
||||||
href: vm.cancelUrl
|
href: vm.cancelUrl
|
||||||
|
|
Reference in a new issue