Fix error message when saving an empty usercss. Closes #795
This commit is contained in:
parent
c0fd71dda6
commit
a01645daf0
|
@ -1161,6 +1161,10 @@
|
|||
"message": "Restore removed section",
|
||||
"description": "Label for the button to restore a removed section"
|
||||
},
|
||||
"sectionEmpty": {
|
||||
"message": "Not saved due to lack of usercss sections.\n\nAdd at least one @-moz-document domain(\"example.com\") {} section",
|
||||
"description": "Error shown when the user tries to save an empty usercss style"
|
||||
},
|
||||
"shortcuts": {
|
||||
"message": "Shortcuts",
|
||||
"description": "Go to shortcut configuration"
|
||||
|
|
|
@ -71,6 +71,9 @@ const usercss = (() => {
|
|||
.then(({sections, errors}) => {
|
||||
if (!errors.length) errors = false;
|
||||
if (!sections.length || errors && !allowErrors) {
|
||||
if (!errors) {
|
||||
errors = chrome.i18n.getMessage('sectionEmpty');
|
||||
}
|
||||
throw errors;
|
||||
}
|
||||
style.sections = sections;
|
||||
|
|
Loading…
Reference in New Issue
Block a user