Skip to content

Commit

Permalink
Corrige commit metadados wp_link
Browse files Browse the repository at this point in the history
  • Loading branch information
messiasdias committed Jan 16, 2024
1 parent a6eb963 commit 35898b2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ui/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ let mutations = {
informacoes_extra: (state, informacoes_extra = []) => {
state.informacoes_extra = informacoes_extra
},
metadados: (state, metadados = []) => {
metadados: (state, metadados = {}) => {
state.metadados = metadados
if(metadados.length) {
state.wp_link = `https://api.whatsapp.com/send?
phone=${state.metadados.wp_phone}&text=${encodeURI(state.metadados.wp_message)}`
if(metadados?.wp_phone) {
state.wp_link = `https://api.whatsapp.com/send?phone=${state.metadados.wp_phone}&text=${encodeURI(state.metadados.wp_message)}`
}
}
}
Expand Down

0 comments on commit 35898b2

Please sign in to comment.