Skip to content

Commit

Permalink
Optimize progress messages, fix login window error
Browse files Browse the repository at this point in the history
Issue #5

Signed-off-by: Jochen <rothjochen@gmail.com>
  • Loading branch information
ochorocho committed Jun 11, 2020
1 parent c5ebdb5 commit c717ccd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const action = async context => {
await login(context)
} catch (error) {
if (error.message === 'canceled') {
context.setProgress('Authorization completed', 'completed')
context.cancel()
} else {
console.error(error.message)
Expand Down
5 changes: 2 additions & 3 deletions login.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const electron = require('electron')
const join = require('url-join')
const { protocol } = require('electron')

const BrowserWindow = electron.BrowserWindow || electron.remote.BrowserWindow

const login = context => {
Expand All @@ -26,12 +25,12 @@ const login = context => {
context.config.set('password', credentials.password)

/**
* Resolve prmise and destroy BrowserWindow
* Resolve promise and destroy BrowserWindow
*/
resolve()
authWindow.destroy()
}, function (error) {
console.error(error.message)
console.error(error)
})

const authWindow = new BrowserWindow({
Expand Down
2 changes: 1 addition & 1 deletion share.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const share = (context, filePath) => {
} else {
context.copyToClipboard(body.ocs.data.url + additionalInfo)
context.notify('Nextcloud uploaded, link copied to Clipboard')
context.setProgress('Done', 'completed')
context.setProgress('Upload done and share link created…', 'completed')
}
} catch (error) {
context.notify('Could not get share link: ' + error.message)
Expand Down
1 change: 0 additions & 1 deletion upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const upload = (context, filePath) => {
context.setProgress('Upload finished', 'completed')
share(context, filePath)
})
context.setProgress('Upload finished', 'completed')
}

module.exports = upload

0 comments on commit c717ccd

Please sign in to comment.