mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Fixed broken favourites in code editor
This commit is contained in:
parent
8594656f6e
commit
cd32597d4d
@ -74,8 +74,13 @@ export class CodeEditor extends Component {
|
||||
|
||||
onChildEvent(button.parentElement, '.lang-option-favorite-toggle', 'click', () => {
|
||||
isFavorite = !isFavorite;
|
||||
const action = isFavorite ? this.favourites.add : this.favourites.delete;
|
||||
action(language);
|
||||
|
||||
if (isFavorite) {
|
||||
this.favourites.add(language);
|
||||
} else {
|
||||
this.favourites.delete(language);
|
||||
}
|
||||
|
||||
button.setAttribute('data-favourite', isFavorite ? 'true' : 'false');
|
||||
|
||||
window.$http.patch('/preferences/update-code-language-favourite', {
|
||||
|
Loading…
Reference in New Issue
Block a user