Skip to content

Commit bf1727e

Browse files
committed
🐛 書き換え忘れ
1 parent 5520624 commit bf1727e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

browser/websocket/shortcuts.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { makeChanges } from "./makeChanges.ts";
44
import { pull } from "./pull.ts";
55
import { pinNumber } from "./pin.ts";
66
import type { Line } from "../../deps/scrapbox.ts";
7-
import { ensureEditablePage, pushCommit, pushWithRetry } from "./_fetch.ts";
7+
import { pushCommit, pushWithRetry } from "./_fetch.ts";
88

99
/** 指定したページを削除する
1010
*
@@ -16,23 +16,22 @@ export async function deletePage(
1616
title: string,
1717
): Promise<void> {
1818
const [
19-
{ id: pageId, commitId: initialCommitId, persistent },
19+
{ pageId, commitId: parentId, persistent },
2020
projectId,
2121
userId,
2222
] = await Promise.all([
23-
ensureEditablePage(project, title),
23+
pull(project, title),
2424
getProjectId(project),
2525
getUserId(),
2626
]);
27-
let parentId = initialCommitId;
2827

29-
if (!persistent) return;
28+
if (persistent) return;
3029

3130
const io = await socketIO();
3231
const { request } = wrap(io);
3332

3433
try {
35-
parentId = await pushWithRetry(request, [{ deleted: true }], {
34+
await pushWithRetry(request, [{ deleted: true }], {
3635
projectId,
3736
pageId,
3837
parentId,

0 commit comments

Comments
 (0)