Skip to content

Commit

Permalink
Add emits option
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 15, 2024
1 parent baef21c commit 620f8c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion api/web/src/components/CloudTAK/util/SettingsCallsign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,22 @@ export default {
TablerEnum,
TablerLoading,
},
emits: [
'update'
],
data: function() {
return {
loading: true,
profile: {},
config: {}
}
},
props: {
mode: {
type: String,
default: 'router'
}
},
computed: {
tak_groups: function() {
const groups = [];
Expand Down Expand Up @@ -107,7 +116,11 @@ export default {
profile.tak_group = profile.tak_group.replace(/\s-\s.*$/, '');
await profileStore.update(profile);
this.$router.push("/menu/settings");
if (this.mode === 'router') {
this.$router.push("/menu/settings");
} else {
this.$emit('update');
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/web/src/components/CloudTAK/util/WarnConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
</div>
<div class='modal-body text-white'>
<SettingsCallsign/>
<SettingsCallsign mode='emit' @update='$emit("close")'/>
</div>
</TablerModal>
</template>
Expand Down

0 comments on commit 620f8c6

Please sign in to comment.