refactor(frontend): refactor popup api and make sure call dispose callback
Close #14122
This commit is contained in:
@@ -1008,8 +1008,18 @@ function attachGameEvents() {
|
||||
const domX = rect.left + (x * viewScale);
|
||||
const domY = rect.top + (y * viewScale);
|
||||
const scoreUnit = getScoreUnit(props.gameMode);
|
||||
os.popup(MkRippleEffect, { x: domX, y: domY }, {}, 'end');
|
||||
os.popup(MkPlusOneEffect, { x: domX, y: domY, value: scoreDelta + (scoreUnit === 'pt' ? '' : scoreUnit) }, {}, 'end');
|
||||
|
||||
{
|
||||
const { dispose } = os.popup(MkRippleEffect, { x: domX, y: domY }, {
|
||||
end: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const { dispose } = os.popup(MkPlusOneEffect, { x: domX, y: domY, value: scoreDelta + (scoreUnit === 'pt' ? '' : scoreUnit) }, {
|
||||
end: () => dispose(),
|
||||
});
|
||||
}
|
||||
|
||||
if (nextMono) {
|
||||
const def = monoDefinitions.value.find(x => x.id === nextMono.id)!;
|
||||
|
Reference in New Issue
Block a user