File tree Expand file tree Collapse file tree 7 files changed +13
-21
lines changed Expand file tree Collapse file tree 7 files changed +13
-21
lines changed Original file line number Diff line number Diff line change 15
15
"dependencies" : {
16
16
"@quasar/extras" : " ^1.3.1" ,
17
17
"axios" : " ^0.19.0" ,
18
- "electron-positioner" : " ^4.1.0" ,
19
18
"electron-store" : " ^5.0.0" ,
20
19
"electron-util" : " ^0.12.1" ,
21
20
"fs-extra" : " ^8.1.0" ,
Original file line number Diff line number Diff line change @@ -476,8 +476,8 @@ export default {
476
476
properties: [' openFile' ],
477
477
filters: [{ name: ' JSON' , extensions: [' json' ] }],
478
478
});
479
- if (dialogResult) {
480
- const importedFile = await fs .readJSON (dialogResult[0 ]);
479
+ if (! dialogResult . canceled && dialogResult . filePaths ) {
480
+ const importedFile = await fs .readJSON (dialogResult . filePaths [0 ]);
481
481
this .data = clonedeep (importedFile);
482
482
}
483
483
},
@@ -486,8 +486,8 @@ export default {
486
486
const dialogResult = await dialog .showSaveDialog ({
487
487
defaultPath: ' source.json' ,
488
488
});
489
- if (dialogResult) {
490
- await fs .writeJson (dialogResult, this .siteList );
489
+ if (! dialogResult . canceled && dialogResult . filePath ) {
490
+ await fs .writeJson (dialogResult . filePath , this .siteList );
491
491
}
492
492
},
493
493
closeConfig () {
Original file line number Diff line number Diff line change @@ -51,12 +51,12 @@ export default {
51
51
... mapMutations ([' setSiteList' ]),
52
52
async openDialog () {
53
53
const { dialog } = this .$q .electron .remote ;
54
- const dialogResult = dialog .showOpenDialog ({
54
+ const dialogResult = await dialog .showOpenDialog ({
55
55
properties: [' openFile' ],
56
56
filters: [{ name: ' JSON' , extensions: [' json' ] }],
57
57
});
58
- if (dialogResult) {
59
- const importedFile = await fs .readJSON (dialogResult[0 ]);
58
+ if (! dialogResult . canceled && dialogResult . filePaths ) {
59
+ const importedFile = await fs .readJSON (dialogResult . filePaths [0 ]);
60
60
this .setSiteList (importedFile);
61
61
this .$router .push (' /' );
62
62
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export default {
62
62
normalizeUrl (url ) {
63
63
if (isAbsoluteUrl (url)) {
64
64
const pureUrl = url .replace (/ (. *? )\$ / , ' ' ).replace (/ \$ (. * )/ , ' ' );
65
- return normalizeUrl (pureUrl);
65
+ return normalizeUrl (pureUrl, { stripWWW : false } );
66
66
}
67
67
68
68
return ' ' ;
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ import normalizeUrl from 'normalize-url';
105
105
import isAbsoluteUrl from ' is-absolute-url' ;
106
106
import { mapState } from ' vuex' ;
107
107
import { stringify } from ' query-string' ;
108
- import Positioner from ' electron-positioner ' ;
108
+
109
109
import _find from ' lodash/find' ;
110
110
import _get from ' lodash/get' ;
111
111
@@ -205,7 +205,7 @@ export default {
205
205
},
206
206
normalizeUrl (url ) {
207
207
if (isAbsoluteUrl (url)) {
208
- return normalizeUrl (url);
208
+ return normalizeUrl (url, { stripWWW : false } );
209
209
}
210
210
return ' ' ;
211
211
},
@@ -227,8 +227,8 @@ export default {
227
227
const encodeUrl = stringify ({ video: videoInfo, episode: episodeInfo });
228
228
const parentWindow = getCurrentWindow ();
229
229
const win = new BrowserWindow ({
230
- width: 800 ,
231
- height: 600 ,
230
+ width: 400 ,
231
+ height: 300 ,
232
232
useContentSize: true ,
233
233
webPreferences: {
234
234
nodeIntegration: true ,
@@ -237,8 +237,6 @@ export default {
237
237
parent: parentWindow,
238
238
});
239
239
win .removeMenu ();
240
- const positioner = new Positioner (win);
241
- positioner .move (' bottomRight' );
242
240
win .loadURL (` ${ process .env .APP_URL } #/mini-video?${ encodeUrl} ` );
243
241
},
244
242
errorHandler (event , data ) {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export default {
50
50
normalizeUrl (url ) {
51
51
if (isAbsoluteUrl (url)) {
52
52
const pureUrl = url .replace (/ (. *? )\$ / , ' ' ).replace (/ \$ (. * )/ , ' ' );
53
- return normalizeUrl (pureUrl);
53
+ return normalizeUrl (pureUrl, { stripWWW : false } );
54
54
}
55
55
56
56
return ' ' ;
Original file line number Diff line number Diff line change @@ -3436,11 +3436,6 @@ electron-packager@^14.0.6:
3436
3436
semver "^6.0.0"
3437
3437
yargs-parser "^13.0.0"
3438
3438
3439
- electron-positioner@^4.1.0 :
3440
- version "4.1.0"
3441
- resolved "https://registry.npm.taobao.org/electron-positioner/download/electron-positioner-4.1.0.tgz#e158f8f6aabd6725a8a9b4f2279b9504bcbea1b0"
3442
- integrity sha1-4Vj49qq9ZyWoqbTyJ5uVBLy+obA=
3443
-
3444
3439
electron-publish@21.2.0 :
3445
3440
version "21.2.0"
3446
3441
resolved "https://registry.npm.taobao.org/electron-publish/download/electron-publish-21.2.0.tgz#cc225cb46aa62e74b899f2f7299b396c9802387d"
You can’t perform that action at this time.
0 commit comments