1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed for nextjs, but it won't work

This commit is contained in:
Fedor Katurov 2020-11-06 18:36:28 +07:00
parent 33e9e01f29
commit 4b79b06106
39 changed files with 64 additions and 63 deletions

View file

@ -1,9 +1,9 @@
import curry from 'ramda/es/curry';
import insert from 'ramda/es/insert';
import nth from 'ramda/es/nth';
import remove from 'ramda/es/remove';
import { curry } from 'ramda';
import { insert } from 'ramda';
import { nth } from 'ramda';
import { remove } from 'ramda';
import { ICommentGroup, IComment } from '~/redux/types';
import path from 'ramda/es/path';
import { path } from 'ramda';
export const moveArrItem = curry((at, to, list) => insert(to, nth(at, list), remove(at, 1, list)));
export const objFromArray = (array: any[], key: string) =>

View file

@ -1,7 +1,7 @@
import { USER_ROLES } from '~/redux/auth/constants';
import { ICommentGroup, INode } from '~/redux/types';
import { IUser } from '~/redux/auth/types';
import path from 'ramda/es/path';
import { path } from 'ramda';
import { NODE_TYPES } from '~/redux/node/constants';
export const canEditNode = (node: Partial<INode>, user: Partial<IUser>): boolean =>

View file

@ -17,7 +17,7 @@ export interface IPlayerProgress {
export class PlayerClass {
public constructor() {
this.element.addEventListener('timeupdate', () => {
this.element?.addEventListener('timeupdate', () => {
const { duration: total, currentTime: current } = this.element;
const progress = parseFloat(((current / total) * 100).toFixed(2));
@ -36,7 +36,7 @@ export class PlayerClass {
public total: number = 0;
public element: HTMLAudioElement = new Audio();
public element: HTMLAudioElement = typeof Audio !== 'undefined' ? new Audio() : null;
public duration: number = 0;
@ -45,11 +45,11 @@ export class PlayerClass {
};
public on = (type: string, callback) => {
this.element.addEventListener(type, callback);
this.element?.addEventListener(type, callback);
};
public off = (type: string, callback) => {
this.element.removeEventListener(type, callback);
this.element?.removeEventListener(type, callback);
};
public load = () => {