summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/drive.file.info.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/pages/drive.file.info.vue')
-rw-r--r--packages/frontend/src/pages/drive.file.info.vue24
1 files changed, 15 insertions, 9 deletions
diff --git a/packages/frontend/src/pages/drive.file.info.vue b/packages/frontend/src/pages/drive.file.info.vue
index 79c249413a..e3cc1d988e 100644
--- a/packages/frontend/src/pages/drive.file.info.vue
+++ b/packages/frontend/src/pages/drive.file.info.vue
@@ -119,7 +119,7 @@ async function _fetch_() {
}
function postThis() {
- if (!file.value) return;
+ if (file.value == null) return;
os.post({
initialFiles: [file.value],
@@ -127,11 +127,13 @@ function postThis() {
}
function move() {
- if (!file.value) return;
+ if (file.value == null) return;
+
+ const f = file.value;
selectDriveFolder(null).then(folder => {
misskeyApi('drive/files/update', {
- fileId: file.value.id,
+ fileId: f.id,
folderId: folder[0] ? folder[0].id : null,
}).then(async () => {
await _fetch_();
@@ -140,7 +142,7 @@ function move() {
}
function toggleSensitive() {
- if (!file.value) return;
+ if (file.value == null) return;
os.apiWithDialog('drive/files/update', {
fileId: file.value.id,
@@ -157,7 +159,9 @@ function toggleSensitive() {
}
function rename() {
- if (!file.value) return;
+ if (file.value == null) return;
+
+ const f = file.value;
os.inputText({
title: i18n.ts.renameFile,
@@ -166,7 +170,7 @@ function rename() {
}).then(({ canceled, result: name }) => {
if (canceled) return;
os.apiWithDialog('drive/files/update', {
- fileId: file.value.id,
+ fileId: f.id,
name: name,
}).then(async () => {
await _fetch_();
@@ -175,7 +179,9 @@ function rename() {
}
async function describe() {
- if (!file.value) return;
+ if (file.value == null) return;
+
+ const f = file.value;
const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkFileCaptionEditWindow.vue').then(x => x.default), {
default: file.value.comment ?? '',
@@ -183,7 +189,7 @@ async function describe() {
}, {
done: caption => {
os.apiWithDialog('drive/files/update', {
- fileId: file.value.id,
+ fileId: f.id,
comment: caption.length === 0 ? null : caption,
}).then(async () => {
await _fetch_();
@@ -194,7 +200,7 @@ async function describe() {
}
async function deleteFile() {
- if (!file.value) return;
+ if (file.value == null) return;
const { canceled } = await os.confirm({
type: 'warning',