Skip to content

Commit

Permalink
Improve docblock LanguagesDropdown::hasChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Nov 14, 2024
1 parent 1d2cbe6 commit 65716d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions panel/src/components/View/Buttons/LanguagesDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export default {
},
computed: {
changesBadge() {
// `hasChanges` provides the state for all other than the current
// translation from the backend; for the current translation we need to
// check `content.hasChanges` as this state can change dynamically without
// any other backend request that would update `hasChanges`
if (this.hasChanges || this.$panel.content.hasChanges) {
return {
theme: this.$panel.content.lock.isLocked ? "red" : "orange"
Expand Down
4 changes: 2 additions & 2 deletions src/Panel/Ui/Buttons/LanguagesDropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class: 'k-languages-dropdown',

/**
* Returns if any translation other than the current one has unsaved changes
* (the current will be considered dynamically in `<k-languages-dropdown>`
* based on its state)
* (the current language has to be handled in `k-languages-dropdown` as its
* state can change dynamically without another backend request)
*/
public function hasChanges(): bool
{
Expand Down

0 comments on commit 65716d4

Please sign in to comment.