Skip to content

Commit

Permalink
fix: do not remove root context
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Aug 2, 2020
1 parent df79c98 commit de1042f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/fluent-vue/src/fluentVue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export function createFluentVue(options: FluentVueOptions): FluentVue {

set bundles(value: FluentBundle[]) {
rootContext.bundles = value
rootContext.refresh()

for (const context of contexts.keys()) {
context.refresh()
Expand Down
5 changes: 4 additions & 1 deletion packages/fluent-vue/src/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function createMixin(fluent: FluentVue, rootContext: TranslationContext)
return
}

fluent.removeContext(this._fluent)
if (this._fluent !== rootContext) {
fluent.removeContext(this._fluent)
}

fluent.unsubscribe(this)

this.$nextTick(() => {
Expand Down

0 comments on commit de1042f

Please sign in to comment.