null check added
path to confetti fixed after refactoring
This commit is contained in:
parent
0e53e220d0
commit
1bf7ff8994
1 changed files with 5 additions and 3 deletions
|
@ -34,11 +34,11 @@ const EffectsOverlay: FunctionComponent<EffectsOverlayProps> = ({ roomWidth }) =
|
||||||
if (effect === null) {
|
if (effect === null) {
|
||||||
const options = CHAT_EFFECTS.find((e) => e.command === name)?.options
|
const options = CHAT_EFFECTS.find((e) => e.command === name)?.options
|
||||||
try {
|
try {
|
||||||
const { default: Effect }: { default: ICanvasEffectConstructable } = await import(`./${name}`);
|
const { default: Effect }: { default: ICanvasEffectConstructable } = await import(`../../../effects/${name}`);
|
||||||
effect = new Effect(options);
|
effect = new Effect(options);
|
||||||
effectsRef.current[name] = effect;
|
effectsRef.current[name] = effect;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn('Unable to load effect module at \'./${name}\'.', err)
|
console.warn('Unable to load effect module at \'../../../effects/${name}\'.', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return effect;
|
return effect;
|
||||||
|
@ -46,7 +46,9 @@ const EffectsOverlay: FunctionComponent<EffectsOverlayProps> = ({ roomWidth }) =
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const resize = () => {
|
const resize = () => {
|
||||||
|
if (canvasRef.current) {
|
||||||
canvasRef.current.height = window.innerHeight;
|
canvasRef.current.height = window.innerHeight;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const onAction = (payload: { action: string }) => {
|
const onAction = (payload: { action: string }) => {
|
||||||
const actionPrefix = 'effects.';
|
const actionPrefix = 'effects.';
|
||||||
|
|
Loading…
Reference in a new issue