Skip to content

Commit 738e4ba

Browse files
committed
♻️ oauth check token before check close
1 parent f8fa0d7 commit 738e4ba

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

.github/reset-dev.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,19 @@ fi
2121
echo -e "\033[37;42;1mMixed reset to $_hash, exclude package.json\033[0m"
2222
read -p "Any key to continue, Ctrl+C to cancel"
2323

24-
git stash
24+
_stash=false
25+
if ! git diff --quiet; then
26+
git stash
27+
_stash=true
28+
fi
29+
2530
git reset --mixed $_hash
2631
git add 'package.json' '**package.json'
2732
git restore .
28-
git stash pop
33+
34+
if $_stash; then
35+
git stash pop
36+
fi
2937

3038
echo -e "\n\n## $_tag\n\n"
3139
git --no-pager log --invert-grep --grep='bumping versions' --grep='Merge pull request' --pretty=format:"- %h %s" $_tag..HEAD

layers/common/composables/UseOauthLogin.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,12 @@ export function useOauthLogin(options: OauthLoginOption) {
4040
}
4141

4242
async function checking(authType: string, url: string) {
43-
if (!popupWin.opening()) { // failed pop open or closed
44-
authing(LoadingStatus.Done);
45-
return;
46-
}
47-
43+
const open = popupWin.opening();
4844
try {
4945
const next = await options.checkToken(authType, url);
50-
if (typeof next === 'boolean') {
51-
popupWin.close();
46+
if (typeof next === 'boolean' || !open) {
5247
authing(LoadingStatus.Done);
48+
if (open) popupWin.close();
5349
}
5450
else {
5551
setTimeout(() => checking(authType, url), next);
@@ -58,7 +54,7 @@ export function useOauthLogin(options: OauthLoginOption) {
5854
catch (err) {
5955
logger.error('check oauth token failed', err);
6056
authing(LoadingStatus.Error);
61-
popupWin.close();
57+
if (open) popupWin.close();
6258
}
6359
}
6460

layers/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fessional/razor-common",
3-
"version": "0.8.1-dev.11",
3+
"version": "0.8.1-dev.12",
44
"description": "common layer for mobile and desktop",
55
"type": "module",
66
"main": "./nuxt.config.ts",

layers/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fessional/razor-desktop",
3-
"version": "0.8.1-dev.11",
3+
"version": "0.8.1-dev.12",
44
"description": "desktop layer with vuetify",
55
"type": "module",
66
"main": "./nuxt.config.ts",

layers/mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fessional/razor-mobile",
3-
"version": "0.8.1-dev.11",
3+
"version": "0.8.1-dev.12",
44
"description": "mobile layer with ionic and capacitor",
55
"type": "module",
66
"main": "./nuxt.config.ts",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fessional/razor",
3-
"version": "0.8.1-dev.11",
3+
"version": "0.8.1-dev.12",
44
"description": "Use front-end tech (Nuxt/Ts) to build multi-platform from one codebase, suitable for small team and app to write app once, apply almost anywhere.",
55
"type": "module",
66
"files": [

0 commit comments

Comments
 (0)