Skip to content

Commit d24a093

Browse files
committed
[other] show feedback/rating promt message
1 parent f156136 commit d24a093

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

src/StringTable.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,18 @@ export const view_str$prompt$project_is_opened_by_another = [
592592
`Can't lock project: '{path}', maybe this project has been opened by another EIDE instance !`
593593
][langIndex];
594594

595+
export const view_str$prompt$feedback = [
596+
`已经过去了一段时间,Embedded IDE 这款插件有帮到你吗?您可以在插件商店给予一个评分以帮助我们了解您的感受!`,
597+
`A few days passed, has this plugin(Embedded IDE) helped you ? You can help us know how you feel by giving us a rating in the plugin store !`
598+
][langIndex];
599+
595600
//---------------Select string------------------
596601

602+
export const rating_text = [
603+
'打分',
604+
'Rating'
605+
][langIndex];
606+
597607
export const later_text = [
598608
'稍后',
599609
'Later on'

src/extension.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { ResInstaller } from './ResInstaller';
4040
import {
4141
ERROR, WARNING, INFORMATION,
4242
view_str$operation$serialport, view_str$operation$baudrate, view_str$operation$serialport_name,
43-
txt_install_now, txt_yes
43+
txt_install_now, txt_yes, view_str$prompt$feedback, rating_text, later_text
4444
} from './StringTable';
4545
import { LogDumper } from './LogDumper';
4646
import { StatusBarManager } from './StatusBarManager';
@@ -294,6 +294,23 @@ function postLaunchHook(extensionCtx: vscode.ExtensionContext) {
294294
}
295295
}
296296

297+
// not first launch
298+
else {
299+
300+
// A few days ago, show feedback message
301+
const some_days = 7 * (24 * 3600 * 1000);
302+
if (!appUsrData['Feedbacked'] &&
303+
Date.now() - appUsrData['InstallTime'] > some_days) {
304+
resManager.setAppUsrData('Feedbacked', true);
305+
const msg = view_str$prompt$feedback;
306+
vscode.window.showInformationMessage(msg, rating_text).then((ans) => {
307+
if (ans == rating_text) {
308+
utility.openUrl(`https://marketplace.visualstudio.com/items?itemName=CL.eide&ssr=false#review-details`);
309+
}
310+
});
311+
}
312+
}
313+
297314
// refresh external tools now
298315
ResInstaller.instance().refreshExternalToolsIndex().catch(err => {
299316
GlobalEvent.emit('globalLog', ExceptionToMessage(err, 'Warning'));

0 commit comments

Comments
 (0)