diff --git a/extension.js b/extension.js index add21b9..9947203 100644 --- a/extension.js +++ b/extension.js @@ -32,27 +32,7 @@ const getRandomHadith = async () => { return hadith; }; -/** - * @param {vscode.ExtensionContext} context - */ - -function activate(context) { - let disposable = vscode.commands.registerCommand( - "hadith.getHadith", - async function () { - getRandomHadith() - .then(function (response) { - vscode.window.showInformationMessage(response); - }) - .catch((error) => { - console.log("error11: ", error); - vscode.window.showInformationMessage( - "✨ إِنَّ اللَّهَ وَمَلائِكَتَهُ يُصَلُّونَ عَلَى النَّبِيِّ يَا أَيُّهَا الَّذِينَ آمَنُوا صَلُّوا عَلَيْهِ وَسَلِّمُوا تَسْلِيمًا" - ); - }); - } - ); - +function activate() { const repeatedEveryMinute = vscode.workspace .getConfiguration("hadith") .get("repeatedEveryMinute"); @@ -64,14 +44,12 @@ function activate(context) { .then(function (response) { vscode.window.showInformationMessage(response, "X"); }) - .catch((error) => { + .catch(() => { vscode.window.showInformationMessage( "✨ إِنَّ اللَّهَ وَمَلائِكَتَهُ يُصَلُّونَ عَلَى النَّبِيِّ يَا أَيُّهَا الَّذِينَ آمَنُوا صَلُّوا عَلَيْهِ وَسَلِّمُوا تَسْلِيمًا" ); }); }, convertMinutesToMs); - - context.subscriptions.push(disposable); } function deactivate() {} diff --git a/package.json b/package.json index 5120766..2d34fa7 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,7 @@ "Islam" ], "activationEvents": [ - "*", - "onCommand:hadith.getHadith" + "*" ], "main": "./extension.js", "contributes": {