The issue has been closed

Likewise, we should use the toast in every feature that isn't instantaneous. If you think of any, please list them below.
posted by fregante about 4 years ago
Can I take this? If Yes, Where should I begin?
posted by jayeshmann over 3 years ago
posted by fregante over 3 years ago 
Probably you'll want to change this:
https://github.com/sindresorhus/refined-github/blob/ba878fc91552f41f1860a70864917ca3c40914f4/source/features/restore-file.tsx#L86-L109
To something like:
async function restoreFile() {
const file = await getFile(filePath);
if (!file) {
// The file was created by this PR.
// This code wonβt be reached if `highlight-deleted-and-added-files-in-diffs` works.
throw new Error('Nothing to restore. Delete file instead');
return;
}
if (file.isTruncated) {
throw new Error('Restore failed: File too big');
return;
}
await commitFileContent(menuItem, file.text, filePath);
}
try {
const filePath = menuItem.closest<HTMLDivElement>('[data-path]')!.dataset.path!;
const task = restoreFile(filePath);
showToast(task);
// Hide file from view
await task;
menuItem.closest('.file')!.remove();
} catch (error: unknown) {
features.error(__filebasename, error);
}
posted by fregante over 3 years ago
I hope everything is good now!
posted by jayeshmann over 3 years ago
@yakov116 are there other features that might benefit from this? π€
posted by fregante over 3 years ago
I think the update branch feature and maybe clone-branch
, git-reblame
.
Basically wherever we are using the loading icon.
(On mobile this is what I can think of offhand)
posted by yakov116 over 3 years ago
Basically wherever we are using the loading icon.
Good thinking.
clone-branch
π
git-reblame
.
I think I prefer the small in-place icon in this case, maybe because it's not an action but a link that will change the current page.
posted by fregante over 3 years ago