Skip to content

Commit

Permalink
Merge pull request #491 from Peergos/fix/hex-viewer-option
Browse files Browse the repository at this point in the history
do not show hex viewer if other option available
  • Loading branch information
ianopolous committed Apr 21, 2023
2 parents 389be51 + 4056133 commit 78322b7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/views/Drive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
v-if="viewMenu"
@closeMenu="closeMenu()"
>
<li id='gallery' v-if="canOpen && !isMarkdown && !isHTML" @keyup.enter="viewFile()" @click="viewFile()">View</li>
<li id='gallery' v-if="canOpen && !isMarkdown && !isHTML && !hexViewerAlternativeAvailable" @keyup.enter="viewFile()" @click="viewFile()">View</li>
<li id='view-markdown' v-if="isMarkdown" @keyup.enter="viewFile()" @click="viewFile()">View</li>
<li id='edit-markdown' v-if="isMarkdown" @keyup.enter="editFile()" @click="editFile()">Edit</li>
<li id='view-html' v-if="isHTML && isHTMLViewable" @keyup.enter="viewFile()" @click="viewFile()">View</li>
Expand Down Expand Up @@ -525,6 +525,14 @@ module.exports = {
return false;
}
},
hexViewerAlternativeAvailable() {
if (this.selectedFiles.length == 0)
return;
let file = this.selectedFiles[0];
let filename = file.getName();
let app = this.getApp(file, this.getPath, false);
return this.availableApps.length > 0 && app === "hex";
},
isMarkdown() {
try {
if (this.currentDir == null)
Expand Down

0 comments on commit 78322b7

Please sign in to comment.