Releasing 0.25.77 (#968)

Squash commits
This commit is contained in:
vorotamoroz
2026-06-19 17:45:37 +09:00
committed by GitHub
parent c6c4044f3c
commit 62f44e38c0
453 changed files with 29917 additions and 727 deletions
+10 -5
View File
@@ -32,7 +32,10 @@ function randomId(): string {
}
async function hasReadWritePermission(handle: FileSystemDirectoryHandle, requestIfNeeded: boolean): Promise<boolean> {
const h = handle as any;
const h = handle as unknown as {
queryPermission?: (options: { mode: "readwrite" }) => Promise<PermissionState>;
requestPermission?: (options: { mode: "readwrite" }) => Promise<PermissionState>;
};
if (typeof h.queryPermission === "function") {
const queried = await h.queryPermission({ mode: "readwrite" });
if (queried === "granted") {
@@ -91,7 +94,7 @@ export class VaultHistoryStore {
async getVaultHistory(): Promise<VaultHistoryItem[]> {
return this.withStore("readonly", async (store) => {
const keys = (await this.requestAsPromise(store.getAllKeys()));
const keys = await this.requestAsPromise(store.getAllKeys());
const values = (await this.requestAsPromise(store.getAll())) as unknown[];
const items: VaultHistoryItem[] = [];
for (let i = 0; i < keys.length; i++) {
@@ -172,15 +175,17 @@ export class VaultHistoryStore {
}
async pickNewVault(): Promise<FileSystemDirectoryHandle> {
const picker = (compatGlobal as any).showDirectoryPicker;
const picker = (compatGlobal as unknown as Record<string, unknown>).showDirectoryPicker as
| ((options?: { mode?: "readwrite" | "read"; startIn?: string }) => Promise<FileSystemDirectoryHandle>)
| undefined;
if (typeof picker !== "function") {
throw new Error("FileSystem API showDirectoryPicker is not supported in this browser");
}
const handle = (await picker({
const handle = await picker({
mode: "readwrite",
startIn: "documents",
})) as FileSystemDirectoryHandle;
});
const granted = await hasReadWritePermission(handle, true);
if (!granted) {