File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ router.post('/upload', async ({
4646 urlparams ?: URLSearchParams
4747} ) : Promise < void > => {
4848 try {
49+ const picbed = urlparams ?. get ( 'picbed' )
4950 const passedKey = urlparams ?. get ( 'key' )
5051 const serverKey = picgo . getConfig < string > ( configPaths . settings . serverKey ) || ''
5152 if ( serverKey && passedKey !== serverKey ) {
@@ -58,17 +59,16 @@ router.post('/upload', async ({
5859 } )
5960 return
6061 }
61- const picbed = urlparams ?. get ( 'picbed' )
6262 let currentPicBedType = ''
6363 let currentPicBedConfig = { } as IStringKeyMap
6464 let currentPicBedConfigId = ''
6565 let needRestore = false
6666 if ( picbed ) {
67- const configName = urlparams ?. get ( 'configName' ) || 'Default'
6867 const currentPicBed = picgo . getConfig < IStringKeyMap > ( 'picBed' ) || { } as IStringKeyMap
69- currentPicBedType = currentPicBed ?. current
70- currentPicBedConfig = currentPicBed ?. [ currentPicBedType ]
71- currentPicBedConfigId = currentPicBedConfig ?. _id
68+ currentPicBedType = currentPicBed . current || ''
69+ currentPicBedConfig = currentPicBed [ currentPicBedType ] || { } as IStringKeyMap
70+ currentPicBedConfigId = currentPicBedConfig . _id
71+ const configName = urlparams ?. get ( 'configName' ) || currentPicBed [ picbed ] ?. _configName
7272 if ( picbed === currentPicBedType && configName === currentPicBedConfig . _configName ) {
7373 // do nothing
7474 } else {
You can’t perform that action at this time.
0 commit comments