diff --git a/src/dashboard-client/src/components/user/UserGlobalTokens.vue b/src/dashboard-client/src/components/user/UserGlobalTokens.vue index 46c2de2f..ecb34e58 100644 --- a/src/dashboard-client/src/components/user/UserGlobalTokens.vue +++ b/src/dashboard-client/src/components/user/UserGlobalTokens.vue @@ -82,7 +82,7 @@ {{ t.last_used_at ? formatDate(t.last_used_at) : '—' }} - + @@ -565,10 +565,12 @@ export default { .catch(() => {}) }, - toggleMcpTrigger (token) { - // v-model has already flipped token.allow_trigger to the new value; - // read it directly rather than negating again. - const newVal = token.allow_trigger + toggleMcpTrigger (token, newVal) { + // md-switch emits the new model value via @change. Rely on that + // explicit value rather than reading token.allow_trigger, which is + // not guaranteed to be updated by v-model yet when @change fires + // (that timing gap caused the "first click is a no-op" bug). + token.allow_trigger = newVal UserTokenService.setMcpTrigger(token.token_id, newVal) .catch(() => { token.allow_trigger = !newVal }) },