Skip to content

Commit 08afdee

Browse files
committed
hide drive menu if just one drive or default id is folder id
1 parent f5e7075 commit 08afdee

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

web/dist/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/dist/js/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/App.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
>
1010
</v-toolbar-title>
1111
<v-toolbar-items>
12-
<v-menu offset-y v-if="drives.length">
12+
<v-menu offset-y v-if="filteredDrives.length > 1">
1313
<template v-slot:activator="{ on }">
1414
<v-btn text v-on="on" class="text-none">
1515
<v-icon>mdi-cloud</v-icon>&nbsp;{{
@@ -19,7 +19,7 @@
1919
</template>
2020
<v-list>
2121
<v-list-item
22-
v-for="(item, index) in drives"
22+
v-for="(item, index) in filteredDrives"
2323
:key="index.id"
2424
@click="changeDrive(item.value)"
2525
>
@@ -71,7 +71,14 @@ export default {
7171
if (!!drive && typeof drive === "object") {
7272
return drive
7373
} else {
74-
return { value: id, text: window.props.title }
74+
return { value: id, text: window.props.title, defaultSubdir: true }
75+
}
76+
},
77+
filteredDrives() {
78+
if (!!this.currentDrive.defaultSubdir) {
79+
return [this.currentDrive]
80+
} else {
81+
return this.drives
7582
}
7683
}
7784
},

0 commit comments

Comments
 (0)