Skip to content

copy/delete confirmation dialogs #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ui/arduino2/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ async function store(state, emitter) {

for (let i in state.selectedFiles) {
const file = state.selectedFiles[i]
const confirmAction = confirm(`You are about to delete ${file.fileName} from your ${file.source}.\nAre you sure you want to proceed?`, 'Cancel', 'Yes')
if (!confirmAction) {
continue
}
if (file.source === 'board') {
await serial.removeFile(
serial.getFullPath(
Expand All @@ -388,7 +392,7 @@ async function store(state, emitter) {
}

emitter.emit('refresh-files')

state.selectedFiles = []
state.isRemoving = false
emitter.emit('render')
})
Expand Down Expand Up @@ -530,6 +534,10 @@ async function store(state, emitter) {

for (let i in state.selectedFiles) {
const file = state.selectedFiles[i]
const confirmAction = confirm(`Copying ${file.fileName} might overwrite an existing file at destination.\nAre you sure you want to proceed?`, 'Cancel', 'Yes')
if (!confirmAction) {
continue
}
await serial.uploadFile(
disk.getFullPath(
state.diskNavigationRoot,
Expand Down Expand Up @@ -559,6 +567,10 @@ async function store(state, emitter) {

for (let i in state.selectedFiles) {
const file = state.selectedFiles[i]
const confirmAction = confirm(`Copying ${file.fileName} might overwrite an existing file, are you sure you want to proceed?`, 'Cancel', 'Yes')
if (!confirmAction) {
continue
}
await serial.downloadFile(
serial.getFullPath(
'/',
Expand Down