aboutsummaryrefslogtreecommitdiffstats
path: root/loggedin.js
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-13 16:13:03 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-13 16:13:03 +0200
commita66f9b08e57ec10a484d6ca658ce52a7096870be (patch)
tree60bece47786a1289ae11345ae303cc4761d87fc5 /loggedin.js
parent4bd4895ea131541190a5154c5f0de0380ef38842 (diff)
downloadfileup-a66f9b08e57ec10a484d6ca658ce52a7096870be.tar.gz
can no longer rename the fucking trashcan
Diffstat (limited to 'loggedin.js')
-rw-r--r--loggedin.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/loggedin.js b/loggedin.js
index 8de7c2b..9a37c91 100644
--- a/loggedin.js
+++ b/loggedin.js
@@ -407,6 +407,7 @@ function make_window(pwd) {
function add_file_visuals(fileview) {
var is_in_trash = focus.pwd.length == 1 && focus.pwd[0] == "trash";
+ var is_trash = focus.pwd.length == 0 && fileview.filename == "trash";
var visuals = document.createElement('div');
fileview.visuals = visuals;
@@ -442,7 +443,7 @@ function add_file_visuals(fileview) {
if (is_in_trash) {
context_list.push(['Restore', () => { restore_from_trash(fileview.filename); }]);
context_list.push(['Delete forever', () => { delete_file(fileview.filename); }]);
- } else {
+ } else if (!is_trash) {
context_list.push(
['Rename', () => { rename_file(fileview.filename); }],
['Share', () => {alert('not implemented')}],
@@ -479,6 +480,8 @@ function add_file_visuals(fileview) {
if (is_in_trash) {
var split = fileview.filename.split("/");
filename.innerText = split[split.length - 1];
+ } else if (is_trash) {
+ filename.innerText = "Trash";
} else {
filename.innerText = fileview.filename;
}