Commit fade38b 1 parent 770578b commit fade38b Copy full SHA for fade38b
File tree 2 files changed +8
-12
lines changed
renderer/windows/main/components
2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,13 @@ export default class UserService extends Service {
183
183
184
184
async init ( ) {
185
185
this . refreshUser ( ) ;
186
+ if ( this . state . user . selectedUser . id === '' && Object . keys ( this . state . user . users ) . length > 0 ) {
187
+ const [ userId , user ] = Object . entries ( this . state . user . users ) [ 0 ] ;
188
+ this . switchUserProfile ( {
189
+ userId,
190
+ profileId : user . selectedProfile ,
191
+ } ) ;
192
+ }
186
193
}
187
194
188
195
/**
@@ -550,7 +557,7 @@ export default class UserService extends Service {
550
557
selectedProfile : result . selectedProfile ? result . selectedProfile . id : '' ,
551
558
} ) ;
552
559
}
553
- if ( options . selectProfile && result . selectedProfile ) {
560
+ if ( ! this . state . user . selectedUser . id || ( options . selectProfile && result . selectedProfile ) ) {
554
561
this . log ( `Select the game profile ${ result . selectedProfile . id } in user ${ result . user ! . id } ` ) ;
555
562
this . commit ( 'userGameProfileSelect' , {
556
563
profileId : result . selectedProfile . id ,
Original file line number Diff line number Diff line change 31
31
style =" display : block !important ;"
32
32
/>
33
33
<v-list-tile
34
- :disabled =" !logined"
35
34
replace
36
35
to =" /"
37
36
>
40
39
</v-list-tile-action >
41
40
</v-list-tile >
42
41
<v-list-tile
43
- :disabled =" !logined"
44
42
replace
45
43
to =" /instances"
46
44
>
49
47
</v-list-tile-action >
50
48
</v-list-tile >
51
49
<v-list-tile
52
- :disabled =" !logined"
53
50
replace
54
51
to =" /user"
55
52
>
58
55
</v-list-tile-action >
59
56
</v-list-tile >
60
57
<v-list-tile
61
- :disabled =" !logined"
62
58
replace
63
59
to =" /curseforge"
64
60
>
@@ -117,16 +113,13 @@ import {
117
113
} from ' @vue/composition-api' ;
118
114
import {
119
115
useRouter ,
120
- useCurrentUser ,
121
- useUserProfileStatus ,
122
116
useTaskCount ,
123
117
} from ' @/hooks' ;
124
118
import { useDialog , useAsyncRouteBeforeLeaves } from ' ../hooks' ;
125
119
126
120
export default defineComponent ({
127
121
setup() {
128
122
const { activeTasksCount } = useTaskCount ();
129
- const { accessTokenValid : logined } = useUserProfileStatus (useCurrentUser ().userProfile );
130
123
const { show } = useDialog (' task' );
131
124
const beforeLeaves = useAsyncRouteBeforeLeaves ();
132
125
@@ -145,9 +138,6 @@ export default defineComponent({
145
138
if (! timeTraveling ) localHistory .push (from .fullPath );
146
139
});
147
140
async function goBack() {
148
- if (! logined .value && router .currentRoute .path === ' /login' ) {
149
- return ;
150
- }
151
141
timeTraveling = true ;
152
142
const before = localHistory .pop ();
153
143
if (before ) {
@@ -167,7 +157,6 @@ export default defineComponent({
167
157
activeTasksCount ,
168
158
showTaskDialog: show ,
169
159
goBack ,
170
- logined ,
171
160
onEnterBar() {
172
161
startHoverTime = Date .now ();
173
162
},
You can’t perform that action at this time.
0 commit comments