Skip to content
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

2.1.8 fix token error and optimize saving experience #145

Merged
merged 3 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cn.memocast.app",
"version": "2.1.7",
"version": "2.1.8",
"description": "An Awesome WizNote Desktop Application",
"productName": "Memocast",
"author": "tanknee <[email protected]>",
Expand All @@ -16,9 +16,7 @@
"build-develop": "quasar build -m electron -d",
"build-publish": "quasar build -m electron -P always",
"build-all": "quasar build -m electron -T all -P",
"build": "quasar build -m electron",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
"build": "quasar build -m electron"
},
"dependencies": {
"@altairwei/wiz-markdown": "^1.0.13",
Expand Down Expand Up @@ -91,9 +89,7 @@
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.1.2",
"html2canvas": "^1.0.0-rc.7",
"strip-ansi": "^3.0.1",
"vuepress": "^1.8.2",
"vuepress-theme-yuu": "^3.1.1"
"strip-ansi": "^3.0.1"
},
"browserslist": [
"last 10 Chrome versions",
Expand Down
3 changes: 2 additions & 1 deletion src/ScheduleHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import api from 'src/utils/api'
import debugLogger from './utils/debugLogger'
import ServerFileStorage from './utils/storage/ServerFileStorage'
const refreshWizToken = (app) => {
schedule.scheduleJob('30 */12 * * * *', async () => {
schedule.scheduleJob('30 * * * * *', async () => {
if (!ServerFileStorage.isKeyExistsInLocalStorage('token') || !app.isLogin) return
try {
debugLogger.Log('Keep Token Alive')
await api.AccountServerApi.keepTokenAlive()
} catch (e) {
await app.reLogin()
Expand Down
16 changes: 12 additions & 4 deletions src/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
v-show='dataLoaded && !isOutlineShow && !isSourceMode'
v-ripple
key='wordCount'
:title="$t('wordCount')"
>
<q-tooltip
transition-show="fade"
Expand Down Expand Up @@ -120,7 +119,7 @@
:title="enablePreviewEditor ? $t('lock') : $t('unlock')"
/>
<q-btn
icon='save'
:icon='saveButtonIcon'
class='absolute-bottom-right fab-icon cursor-pointer material-icons-round'
dense
flat
Expand Down Expand Up @@ -196,7 +195,7 @@ export default {
return [0, 0]
},
...mapServerGetters(['currentNote']),
...mapServerState(['contentsList', 'isCurrentNoteLoading']),
...mapServerState(['contentsList', 'isCurrentNoteLoading', 'noteState']),
...mapClientState(['noteListVisible', 'enablePreviewEditor'])
},
data () {
Expand All @@ -210,7 +209,8 @@ export default {
word: '0',
paragraph: '0',
character: '0'
}
},
saveButtonIcon: 'save'
}
},
methods: {
Expand Down Expand Up @@ -278,6 +278,14 @@ export default {
cursor: this.$refs.muya.getCursorPosition()
}
}
},
noteState: function (val, oldVal) {
if (val === 'default' && oldVal === 'changed') {
this.saveButtonIcon = 'check'
setTimeout(() => {
this.saveButtonIcon = 'save'
}, 3000)
}
}
}
}
Expand Down
19 changes: 12 additions & 7 deletions src/store/server/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,16 @@ export default {
'password',
'url'
])
this.dispatch('server/login', {
const result = await api.AccountServerApi.Login({
userId,
password,
url
})

commit(types.LOGIN, {
...result,
isLogin: true
})
},
/**
* 获取指定文件夹下的笔记
Expand Down Expand Up @@ -349,13 +354,13 @@ export default {
api.KnowledgeBaseApi.getCacheKey(kbGuid, docGuid),
null
)
Notify.create({
color: 'primary',
message: i18n.t('saveNoteSuccessfully'),
icon: 'check'
})
await this.dispatch('server/getCategoryNotes')
// Notify.create({
// color: 'primary',
// message: i18n.t('saveNoteSuccessfully'),
// icon: 'check'
// })
commit(types.UPDATE_CURRENT_NOTE, result)
await this.dispatch('server/getCategoryNotes')
}
if (!_.endsWith(title, '.md')) {
Dialog.create({
Expand Down
2 changes: 1 addition & 1 deletion src/store/server/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
}
const data = { kbGuid, kbServer, lang, email, displayName, userGuid, isLogin }
Object.assign(state, data)
state.currentNote = {}
// state.currentNote = {}
return state
},
[types.LOGOUT] (state) {
Expand Down