Skip to content

Commit

Permalink
Stop using this.$data and this.$set where still doing so
Browse files Browse the repository at this point in the history
  • Loading branch information
IRHM committed Jul 15, 2021
1 parent 498ed29 commit be2d591
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ export default class Nav extends Vue {
// Set timeElapsed to `00:00` so you
// get instant feedback once you start recording
this.$data.timeElapsed = "00:00";
this.timeElapsed = "00:00";
// Update elapsed time every second
timer = setInterval(() => {
// Get time elapsed in seconds
const elapsed = (Date.now() - timeoutScheduled) / 1000;
// Update time elapsed in a readable format
this.$data.timeElapsed = `${elapsed.toReadableTimeFromSeconds()}`;
this.timeElapsed = `${elapsed.toReadableTimeFromSeconds()}`;
}, 1000);
} else {
rs.classList.remove("isRecording");
// Clear timer if running and set timeElapsed to empty string
clearTimeout(timer);
this.$data.timeElapsed = ``;
this.timeElapsed = ``;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/Recording.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class RecordingSettingsComponent extends Vue {
// Add video devices to videoDevices
d.video.forEach((vd) => {
this.$data.videoDevices.push(vd);
this.videoDevices.push(vd);
});
// Add audio devices to audioDevicesToRecord
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/DropDown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export default class DropDown extends Vue {
private switchItems(itemClicked: string | DropDownItem) {
// Update itemActive prop with itemClicked on
this.$set(this.$data, "itemActive", itemClicked);
this.itemActive = itemClicked;
this.$emit("item-changed", this.name, this.$data.itemActive);
this.$emit("item-changed", this.name, this.itemActive);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/TextBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class TextBox extends Vue {
// If a folder was selected, set textBox value to it
if (folder != null) {
this.$set(this.$data, "textBoxValue", folder);
this.textBoxValue = folder;
this.textBoxValueUpdated();
}
});
Expand Down

0 comments on commit be2d591

Please sign in to comment.