Fix: check err.code
This commit is contained in:
		
							parent
							
								
									1fe0586b29
								
							
						
					
					
						commit
						2abbf670d8
					
				|  | @ -215,7 +215,7 @@ function createSourceEditor(style) { | ||||||
|       }) |       }) | ||||||
|       .catch(err => { |       .catch(err => { | ||||||
|         if (err.handled) return; |         if (err.handled) return; | ||||||
|         if (err.message === t('styleMissingMeta', 'name')) { |         if (err.code === 'missingMandatory' && err.args.includes('name')) { | ||||||
|           messageBox.confirm(t('usercssReplaceTemplateConfirmation')).then(ok => ok && |           messageBox.confirm(t('usercssReplaceTemplateConfirmation')).then(ok => ok && | ||||||
|             chromeSync.setLZValue('usercssTemplate', code) |             chromeSync.setLZValue('usercssTemplate', code) | ||||||
|               .then(() => chromeSync.getLZValue('usercssTemplate')) |               .then(() => chromeSync.getLZValue('usercssTemplate')) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user