Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Remember the user's selected phone

Acho Arnoldfad323555df7
diff --git a/web/pages/threads/_id/index.vue b/web/pages/threads/_id/index.vue
index 4723f68e..3f1e5848 100644
--- a/web/pages/threads/_id/index.vue
+++ b/web/pages/threads/_id/index.vue
@@ -381,6 +381,7 @@ export default Vue.extend({
},
async loadData() {
+ await this.$store.dispatch('loadUser')
await this.$store.dispatch('loadPhones')
await this.$store.dispatch('loadThreads')
diff --git a/web/pages/threads/index.vue b/web/pages/threads/index.vue
index cfb91a06..d1758381 100644
--- a/web/pages/threads/index.vue
+++ b/web/pages/threads/index.vue
@@ -39,6 +39,7 @@ export default {
methods: {
async loadData() {
+ await this.$store.dispatch('loadUser')
await this.$store.dispatch('loadPhones')
await this.$store.dispatch('loadThreads')
},
diff --git a/web/store/index.ts b/web/store/index.ts
index 52a93e07..7e5b54c3 100644
--- a/web/store/index.ts
+++ b/web/store/index.ts
@@ -318,6 +318,15 @@ export const actions = {
const response = await axios.get('/v1/phones', { params: { limit: 100 } })
context.commit('setPhones', response.data.data)
+
+ if (context.state.user && context.state.user.active_phone_id) {
+ const phone = response.data.data.find(
+ (x: Phone) => x.id === context.state.user?.active_phone_id
+ )
+ if (phone) {
+ context.commit('setOwner', phone.phone_number)
+ }
+ }
},
async loadUser(context: ActionContext<State, State>) {