Skip to content

Commit

Permalink
Messages overflow automatically Dismissed withProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
haithamassoli committed Feb 22, 2023
1 parent 2bd23b9 commit d6463f1
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,36 @@ function activate() {
setInterval(async function () {
getRandomHadith()
.then(function (response) {
vscode.window.showInformationMessage(response, "X");
vscode.window.withProgress(
{
location: vscode.ProgressLocation.Notification,
title: response,
cancellable: true,
},
async (progress) => {
progress.report({ increment: 0 });
await new Promise((resolve) =>
setTimeout(resolve, convertMinuteToMs)
);
progress.report({ increment: 100, message: "Done!" });
}
);
})
.catch(() => {
vscode.window.showInformationMessage(
"โœจ ุฅูู†ู‘ูŽ ุงู„ู„ู‘ูŽู‡ูŽ ูˆูŽู…ูŽู„ุงุฆููƒูŽุชูŽู‡ู ูŠูุตูŽู„ู‘ููˆู†ูŽ ุนูŽู„ูŽู‰ ุงู„ู†ู‘ูŽุจููŠู‘ู ูŠูŽุง ุฃูŽูŠู‘ูู‡ูŽุง ุงู„ู‘ูŽุฐููŠู†ูŽ ุขู…ูŽู†ููˆุง ุตูŽู„ู‘ููˆุง ุนูŽู„ูŽูŠู’ู‡ู ูˆูŽุณูŽู„ู‘ูู…ููˆุง ุชูŽุณู’ู„ููŠู…ู‹ุง"
vscode.window.withProgress(
{
location: vscode.ProgressLocation.Notification,
title:
"โœจ ุฅูู†ู‘ูŽ ุงู„ู„ู‘ูŽู‡ูŽ ูˆูŽู…ูŽู„ุงุฆููƒูŽุชูŽู‡ู ูŠูุตูŽู„ู‘ููˆู†ูŽ ุนูŽู„ูŽู‰ ุงู„ู†ู‘ูŽุจููŠู‘ู ูŠูŽุง ุฃูŽูŠู‘ูู‡ูŽุง ุงู„ู‘ูŽุฐููŠู†ูŽ ุขู…ูŽู†ููˆุง ุตูŽู„ู‘ููˆุง ุนูŽู„ูŽูŠู’ู‡ู ูˆูŽุณูŽู„ู‘ูู…ููˆุง ุชูŽุณู’ู„ููŠู…ู‹ุง",
cancellable: true,
},
async (progress) => {
progress.report({ increment: 0 });
await new Promise((resolve) =>
setTimeout(resolve, convertMinuteToMs)
);
progress.report({ increment: 100, message: "Done!" });
}
);
});
}, convertMinutesToMs);
Expand Down

0 comments on commit d6463f1

Please sign in to comment.