更新
This commit is contained in:
parent
1ef3784e3d
commit
529c789315
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,9 +1,19 @@
|
||||
# TODO
|
||||
|
||||
- 翻译:baza npc商店、imarket、imarket搜索结果
|
||||
- log重构,通知重构
|
||||
|
||||
# CHANGE
|
||||
|
||||
## 0.8.9
|
||||
|
||||
2023年04月24日
|
||||
|
||||
### 修改
|
||||
|
||||
- 战斗相关模块错误修复
|
||||
- 重复通知错误修复
|
||||
|
||||
## 0.8.8
|
||||
|
||||
2023年04月17日
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wuhu-torn-helper",
|
||||
"version": "0.8.8",
|
||||
"version": "0.8.9",
|
||||
"description": "芜湖助手",
|
||||
"scripts": {
|
||||
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -38,10 +38,12 @@ export class Common {
|
||||
private readonly icon: ZhongIcon,
|
||||
private readonly fetchUtils: FetchUtils,
|
||||
private readonly moduleLoader: ModuleLoader,
|
||||
// private readonly msgWrapper: MsgWrapper,
|
||||
) {
|
||||
}
|
||||
|
||||
public resolve(mainMethod) {
|
||||
// window.setInterval(()=>this.msgWrapper.create('test',{sysNotify:true},'info'),2000);
|
||||
|
||||
// fetch方法处理
|
||||
globVars.responseHandlers.push(
|
||||
|
||||
@ -46,7 +46,7 @@ export default class AttackHelper {
|
||||
}
|
||||
|
||||
init(): void {
|
||||
window.setTimeout(() => this.init(), 0);
|
||||
window.setTimeout(() => this._init(), 0);
|
||||
}
|
||||
|
||||
private _init() {
|
||||
|
||||
@ -18,6 +18,7 @@ export default class WindowActiveState {
|
||||
addEventListener('blur', () => this.isFocus = false);
|
||||
}
|
||||
|
||||
// 当前实例是否激活
|
||||
get(): boolean {
|
||||
// 当前窗口获得了焦点 优先级最高
|
||||
if (this.isFocus) return true;
|
||||
|
||||
@ -4,18 +4,21 @@ import IWHNotify from "../../interface/IWHNotify";
|
||||
import { InjectionKey } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import NotificationUtils from "./NotificationUtils";
|
||||
import WindowActiveState from "../action/WindowActiveState";
|
||||
|
||||
@ClassName('MsgWrapper')
|
||||
@Injectable()
|
||||
export default class MsgWrapper {
|
||||
constructor(
|
||||
private readonly notificationUtils: NotificationUtils,
|
||||
private readonly windowActiveState: WindowActiveState,
|
||||
) {
|
||||
}
|
||||
|
||||
create(msg: string, options: IWHNotify = {}, type: 'info' | 'warning' | 'error' | 'success' = 'info') {
|
||||
if (!this.windowActiveState.get()) return null;
|
||||
if (options.sysNotify) {
|
||||
this.notificationUtils.push(msg);
|
||||
this.notificationUtils.push(msg, options);
|
||||
}
|
||||
return ElMessage({
|
||||
message: msg,
|
||||
|
||||
@ -16,6 +16,7 @@ export default class NotificationUtils {
|
||||
private permission: boolean = window.Notification && window.Notification.permission === 'granted';
|
||||
|
||||
public push(msg: string, options: IWHNotify = {}): void {
|
||||
// this.logger.info({msg, options})
|
||||
// let { notifies } = this.global;
|
||||
|
||||
if (options.sysNotify && this.permission) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user