Skip to content

Commit

Permalink
feat(interface): 🚸 add 'Copying from Canvas...' status label
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNZL committed Jul 20, 2022
1 parent eb196dc commit 7f1b463
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/popup/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const buttons: Record<PopupButtonName, Button> = <const>{
buttons.options.addEventListener('click', () => browser.runtime.openOptionsPage());

buttons.fetch.addEventListener('click', async () => {
buttons.fetch.setButtonLabel('Copying from Canvas...');

await Storage.clearSavedCourse();

const [tab] = await browser.tabs.query({ active: true, currentWindow: true });
Expand Down Expand Up @@ -200,7 +202,7 @@ buttons.export.addEventListener('click', async () => {

const createdAssignments = await exportToNotion();

if (!createdAssignments) return;
if (!createdAssignments) return buttons.export.resetHTML();

const createdNames = (createdAssignments.length)
? createdAssignments.reduce((list, { course, name }, index) => list + `${index + 1}. ${course} ${name}\n`, '\n\n')
Expand Down

0 comments on commit 7f1b463

Please sign in to comment.