Skip to content

Commit 01b8a2e

Browse files
committed
Cleanup comments and variables
1 parent 5ec58a0 commit 01b8a2e

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

extension/background.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const timeFormat = {
1010
// Listen for extension updates
1111
chrome.runtime.onUpdateAvailable.addListener((details) => {
1212
console.log('Extension update available:', details.version)
13-
// Check if there's an active meeting
14-
chrome.storage.local.get(["meetingTabId"], function (data) {
15-
if (data.meetingTabId) {
16-
// There's an active meeting, defer the update
13+
// Check if there is an active meeting
14+
chrome.storage.local.get(["meetingTabId"], function (result) {
15+
if (result.meetingTabId) {
16+
// There is an active meeting, defer the update
1717
console.log('Caught event, which will defer this update attempt')
1818
} else {
1919
// No active meeting, apply the update immediately
@@ -62,7 +62,7 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
6262
})
6363
}
6464

65-
if (message.type == "recover_last_transcript_and_download") {
65+
if (message.type == "recover_last_transcript") {
6666
downloadAndPostWebhook()
6767
sendResponse({ message: "Recovery process started" })
6868
}

extension/content.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,20 +586,20 @@ function recoverLastMeeting() {
586586

587587
// Last meeting was not processed for some reason. Need to recover that data, process and download it.
588588
if (result.meetingStartTimestamp !== meetingToDownload.meetingStartTimestamp) {
589-
// Silent failure if last meeting was an empty meeting
589+
// Silent failure if last meeting is an empty meeting
590590
chrome.runtime.sendMessage({
591-
type: "recover_last_transcript_and_download",
591+
type: "recover_last_transcript",
592592
}, function (response) {
593593
console.log(response)
594594
resolve()
595595
return
596596
})
597597
}
598598
}
599-
// First meeting itself ended in a disaster. Need to recover that data, process and download it. Also handles recoveries of versions where "meetingStartTimeStamp" was used, because result.meetings will always be undefined in those versions.
599+
// First meeting itself ended in a disaster. Need to recover that data, process and download it. Also handle recoveries of versions where "meetingStartTimeStamp" was used, because result.meetings will always be undefined in those versions.
600600
else {
601601
chrome.runtime.sendMessage({
602-
type: "recover_last_transcript_and_download",
602+
type: "recover_last_transcript",
603603
}, function (response) {
604604
console.log(response)
605605
resolve()

extension/popup.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ window.onload = function () {
2323
lastMeetingTranscriptLink.addEventListener("click", () => {
2424
chrome.storage.local.get(["meetings", "meetingStartTimestamp", "meetingStartTimeStamp"], function (result) {
2525
// Check if user ever attended a meeting
26+
// Backward compatible chrome storage variable. Old name "meetingStartTimeStamp".
2627
if (result.meetingStartTimestamp || result.meetingStartTimeStamp) {
2728
if (result.meetings && (result.meetings.length > 0)) {
2829

2930
const meetingToDownload = result.meetings[result.meetings.length - 1]
3031

3132
// Check if last meeting was successfully processed and added to meetings
3233
if (result.meetingStartTimestamp === meetingToDownload.meetingStartTimestamp) {
33-
// Silent failure if last meeting was an empty meeting
34+
// Silent failure if last meeting is an empty meeting
3435
chrome.runtime.sendMessage({
3536
type: "download_transcript_at_index",
3637
index: result.meetings.length - 1
@@ -40,18 +41,18 @@ window.onload = function () {
4041
}
4142
// Last meeting was not processed for some reason. Need to recover that data, process and download it.
4243
else {
43-
// Silent failure if last meeting was an empty meeting
44+
// Silent failure if last meeting is an empty meeting
4445
chrome.runtime.sendMessage({
45-
type: "recover_last_transcript_and_download",
46+
type: "recover_last_transcript",
4647
}, function (response) {
4748
console.log(response)
4849
})
4950
}
5051
}
51-
// First meeting itself ended in a disaster. Need to recover that data, process and download it. Also handles recoveries of versions where "meetingStartTimeStamp" was used, because result.meetings will always be undefined in those versions.
52+
// First meeting itself ended in a disaster. Need to recover that data, process and download it. Also handle recoveries of versions where "meetingStartTimeStamp" was used, because result.meetings will always be undefined in those versions.
5253
else {
5354
chrome.runtime.sendMessage({
54-
type: "recover_last_transcript_and_download",
55+
type: "recover_last_transcript",
5556
}, function (response) {
5657
console.log(response)
5758
})

0 commit comments

Comments
 (0)