Skip to content

Commit

Permalink
remove prompt before download since its no longer working ref: #136
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamkrishnar committed Dec 10, 2023
1 parent 3dfe5b0 commit 48f992f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 48 deletions.
4 changes: 0 additions & 4 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
"message": "Enable notifications:",
"description": "Enable Notifications"
},
"promptBeforeDownload": {
"message": "Prompt before download:",
"description": "Prompt before download"
},
"setKey": {
"message": "Set Key",
"description": "Set Key"
Expand Down
4 changes: 0 additions & 4 deletions app/_locales/zh/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
"message": "允许桌面通知",
"description": "允许桌面通知"
},
"promptBeforeDownload": {
"message": "下载前确认",
"description": "下载前确认"
},
"setKey": {
"message": "设置密钥",
"description": "设置密钥"
Expand Down
12 changes: 0 additions & 12 deletions app/scripts/AriaDownloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ async function onGot(result, downloadItem, history) {
header: `Cookie: ${downloadItem.cookies}`,
};
}
if (result.enableDownloadPrompt) {
const newPath = prompt(`Do you want to download:`, downloadItem.filename);
if (newPath == null) {
return;
}

params = {
...params,
...parsePath(newPath),
'summary-interval': 1,
};
}
let inter = null;

await aria2
Expand Down
1 change: 0 additions & 1 deletion app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ async function downloadAgent() {
'motrixAPIkey',
'extensionStatus',
'enableNotifications',
'enableDownloadPrompt',
'minFileSize',
'blacklist',
'motrixPort',
Expand Down
27 changes: 0 additions & 27 deletions app/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function ConfigView() {
const [extensionStatus, setExtensionStatus] = useState(false);
const [enableNotifications, setEnableNotifications] = useState(false);
const [downloadFallback, setDownloadFallback] = useState(true);
const [enableDownloadPrompt, setEnableDownloadPrompt] = useState(false);
const [minFileSize, setMinFileSize] = useState('');
const [blacklist, setBlacklist] = useState([]);
const [darkMode, setDarkMode] = useState(false);
Expand All @@ -33,7 +32,6 @@ function ConfigView() {
'motrixAPIkey',
'extensionStatus',
'enableNotifications',
'enableDownloadPrompt',
'minFileSize',
'blacklist',
'darkMode',
Expand Down Expand Up @@ -81,13 +79,6 @@ function ConfigView() {
setEnableNotifications(result.enableNotifications);
}

if (typeof result.enableDownloadPrompt === 'undefined') {
browser.storage.sync.set({ enableDownloadPrompt: false });
setEnableDownloadPrompt(false);
} else {
setEnableDownloadPrompt(result.enableDownloadPrompt);
}

if (typeof result.blacklist === 'undefined') {
browser.storage.sync.set({ blacklist: [] });
setBlacklist([]);
Expand Down Expand Up @@ -253,24 +244,6 @@ function ConfigView() {
</Box>
</Grid>

{/* Prompt status switch */}
<Grid item xs={6}>
<FormLabel>__MSG_promptBeforeDownload__</FormLabel>
</Grid>
<Grid item xs={2}>
<Box display="flex" justifyContent="center">
<Switch
checked={enableDownloadPrompt}
onClick={() => {
browser.storage.sync.set({
enableDownloadPrompt: !enableDownloadPrompt,
});
setEnableDownloadPrompt((x) => !x);
}}
/>
</Box>
</Grid>

{/* Dark mode switch */}
<Grid item xs={6}>
<FormLabel>__MSG_darkMode__</FormLabel>
Expand Down

0 comments on commit 48f992f

Please sign in to comment.