Skip to content

Commit

Permalink
Revert "refactor(whiteboard): change to selector once insert image (#…
Browse files Browse the repository at this point in the history
…1629)"

This reverts commit c199564.
  • Loading branch information
BlackHole1 authored Aug 5, 2022
1 parent c199564 commit 77a66e4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions desktop/renderer-app/src/stores/whiteboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { makeAutoObservable, observable, runInAction } from "mobx";
import { isMobile, isWindows } from "react-device-detect";
import {
AnimationMode,
ApplianceNames,
DeviceType,
Room,
RoomPhase,
Expand Down Expand Up @@ -556,8 +555,6 @@ export class WhiteboardStore {
// width: width,
// height: height,
// });

windowManager.mainView.setMemberState({ currentApplianceName: ApplianceNames.selector });
};

public insertMediaFile = async (file: CloudStorageFile): Promise<void> => {
Expand Down
3 changes: 1 addition & 2 deletions desktop/renderer-app/src/utils/drag-and-drop/image.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { message } from "antd";
import { v4 as v4uuid } from "uuid";
import { ApplianceNames, Room, Size } from "white-web-sdk";
import type { Room, Size } from "white-web-sdk";
import { listFiles } from "../../api-middleware/flatServer/storage";
import { i18n } from "../i18n";
import { UploadTask } from "../upload-task-manager/upload-task";
Expand Down Expand Up @@ -50,7 +50,6 @@ export async function onDropImage(file: File, x: number, y: number, room: Room):
const { width, height } = await getSize;
room.insertImage({ uuid, centerX: x, centerY: y, width, height, locked: false });
room.completeImageUpload(uuid, cloudFile.fileURL);
room.setMemberState({ currentApplianceName: ApplianceNames.selector });
}

export function getImageSize(file: File): Promise<Size> {
Expand Down
3 changes: 0 additions & 3 deletions web/flat-web/src/stores/whiteboard-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { isMobile, isWindows } from "react-device-detect";
import { v4 as v4uuid } from "uuid";
import {
AnimationMode,
ApplianceNames,
DeviceType,
Room,
RoomPhase,
Expand Down Expand Up @@ -525,8 +524,6 @@ export class WhiteboardStore {
// width: width,
// height: height,
// });

windowManager.mainView.setMemberState({ currentApplianceName: ApplianceNames.selector });
};

public insertMediaFile = async (file: CloudStorageFile): Promise<void> => {
Expand Down
3 changes: 1 addition & 2 deletions web/flat-web/src/utils/drag-and-drop/image.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { message } from "antd";
import { v4 as v4uuid } from "uuid";
import { ApplianceNames, Room, Size } from "white-web-sdk";
import type { Room, Size } from "white-web-sdk";
import { listFiles } from "../../api-middleware/flatServer/storage";
import { i18n } from "../i18n";
import { UploadTask } from "../upload-task-manager/upload-task";
Expand Down Expand Up @@ -50,7 +50,6 @@ export async function onDropImage(file: File, x: number, y: number, room: Room):
const { width, height } = await getSize;
room.insertImage({ uuid, centerX: x, centerY: y, width, height, locked: false });
room.completeImageUpload(uuid, cloudFile.fileURL);
room.setMemberState({ currentApplianceName: ApplianceNames.selector });
}

export function getImageSize(file: File): Promise<Size> {
Expand Down

0 comments on commit 77a66e4

Please sign in to comment.