feat(CallPage): integrate GlobalEmitter for telephone history and voicemail updates

This commit is contained in:
2026-01-03 20:54:08 -06:00
parent d2f5ef1ae1
commit c100aefdd5

View File

@@ -1908,6 +1908,7 @@
<script> <script>
import GlobalState from "../../js/GlobalState"; import GlobalState from "../../js/GlobalState";
import GlobalEmitter from "../../js/GlobalEmitter";
import Utils from "../../js/Utils"; import Utils from "../../js/Utils";
import Compressor from "compressorjs"; import Compressor from "compressorjs";
import MaterialDesignIcon from "../MaterialDesignIcon.vue"; import MaterialDesignIcon from "../MaterialDesignIcon.vue";
@@ -2095,6 +2096,9 @@ export default {
this.getRingtones(); this.getRingtones();
this.getRingtoneStatus(); this.getRingtoneStatus();
GlobalEmitter.on("telephone-history-updated", this.getHistory);
GlobalEmitter.on("telephone-history-updated", this.getVoicemails);
// poll for status // poll for status
this.statusInterval = setInterval(() => { this.statusInterval = setInterval(() => {
this.getStatus(); this.getStatus();
@@ -2127,6 +2131,9 @@ export default {
} }
}, },
beforeUnmount() { beforeUnmount() {
GlobalEmitter.off("telephone-history-updated", this.getHistory);
GlobalEmitter.off("telephone-history-updated", this.getVoicemails);
if (this.statusInterval) clearInterval(this.statusInterval); if (this.statusInterval) clearInterval(this.statusInterval);
if (this.historyInterval) clearInterval(this.historyInterval); if (this.historyInterval) clearInterval(this.historyInterval);
if (this.elapsedTimeInterval) clearInterval(this.elapsedTimeInterval); if (this.elapsedTimeInterval) clearInterval(this.elapsedTimeInterval);