fix: fix label text not changing when changing place activity
This commit is contained in:
parent
f724cd9f3c
commit
bebd685bcd
1 changed files with 2 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ async function ActivityToggle() {
|
||||||
DIV.innerHTML = `
|
DIV.innerHTML = `
|
||||||
<label class="mb-2">
|
<label class="mb-2">
|
||||||
<h5 class="mb-0">Toggle Activity</h5>
|
<h5 class="mb-0">Toggle Activity</h5>
|
||||||
<small class="text-muted">Make your place active or inactive (currently ${Status === true ? 'active' : 'inactive'}).</small>
|
<small class="text-muted">Make your place active or inactive (currently <span id="p+current_place_activity">${Status === true ? 'active' : 'inactive'}</span>).</small>
|
||||||
</label>
|
</label>
|
||||||
<br>
|
<br>
|
||||||
`;
|
`;
|
||||||
|
|
@ -41,6 +41,7 @@ async function ActivityToggle() {
|
||||||
Status = Toggle.isActive;
|
Status = Toggle.isActive;
|
||||||
ActivityBtn.innerText = 'Set ' + (Status === true ? 'Private' : 'Public');
|
ActivityBtn.innerText = 'Set ' + (Status === true ? 'Private' : 'Public');
|
||||||
ActivityBtn.classList = 'btn ' + (Status === true ? 'btn-danger' : 'btn-success');
|
ActivityBtn.classList = 'btn ' + (Status === true ? 'btn-danger' : 'btn-success');
|
||||||
|
Status === true ? document.getElementById('p+current_place_activity').innerText = 'active' : document.getElementById('p+current_place_activity').innerText = 'inactive'
|
||||||
} else {
|
} else {
|
||||||
//chrome.runtime.sendMessage({ action: "sweetalert2", icon: "error", title: "Error", text: Toggle.message });
|
//chrome.runtime.sendMessage({ action: "sweetalert2", icon: "error", title: "Error", text: Toggle.message });
|
||||||
alert(Toggle.message)
|
alert(Toggle.message)
|
||||||
|
|
|
||||||
Reference in a new issue