Skip to content

Commit

Permalink
other tmp work
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane authored and sashankaryal committed Oct 30, 2024
1 parent 0a0790b commit a9f95e5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 21 deletions.
3 changes: 1 addition & 2 deletions app/packages/core/src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,11 @@ function Grid() {

element && spotlight.attach(element);
spotlight.addEventListener("load", mount);
spotlight.addEventListener("rowchange", set);

return () => {
freeVideos();
spotlight.removeEventListener("load", mount);
spotlight.removeEventListener("rowchange", set);

spotlight.destroy();
document.dispatchEvent(new CustomEvent("grid-unmount"));
};
Expand Down
1 change: 1 addition & 0 deletions app/packages/core/src/components/Grid/useAt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default function useAt(pageReset: string) {
const set = useRecoilTransaction_UNSTABLE(
({ set }) =>
({ at, page, offset }: { at: ID; page: number; offset: number }) => {
console.log("SCROLL");
set(gridPage, page);
set(gridAt, at.description);
set(gridOffset, offset);
Expand Down
12 changes: 0 additions & 12 deletions app/packages/core/src/components/Grid/useSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ export default function useSelect(
const { init, deferred } = fos.useDeferrer();

const selected = useRecoilValue(fos.selectedSamples);
useEffect(() => {
deferred(() => {
const fontSize = getFontSize();
spotlight?.updateItems((id) => {
store.get(id)?.updateOptions({
...options,
fontSize,
selected: selected.has(id.description),
});
});
});
}, [deferred, getFontSize, options, selected, spotlight, store]);

useEffect(() => {
return spotlight ? init() : undefined;
Expand Down
4 changes: 2 additions & 2 deletions app/packages/core/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { useRecoilCallback, useRecoilValue } from "recoil";
import styled from "styled-components";
import { ModalActionsRow } from "../Actions";
import Sidebar from "../Sidebar";
import { useLookerHelpers } from "./hooks";
import { modalContext } from "./modal-context";
import ModalNavigation from "./ModalNavigation";
import { ModalSpace } from "./ModalSpace";
import { TooltipInfo } from "./TooltipInfo";
import { useLookerHelpers } from "./hooks";
import { modalContext } from "./modal-context";
import { useModalSidebarRenderEntry } from "./use-sidebar-render-entry";

const ModalWrapper = styled.div`
Expand Down
1 change: 1 addition & 0 deletions app/packages/core/src/plugins/samples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ registerComponent({
name: "Samples",
label: "Samples",
component: () => {
console.log("RENDER");
return (
<Container>
<Grid key={"grid"} />
Expand Down
7 changes: 3 additions & 4 deletions app/packages/looker/src/lookers/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,9 @@ export abstract class AbstractLooker<

destroy() {
this.resizeObserver.disconnect();
this.lookerElement.element.parentElement &&
this.lookerElement.element.parentElement.removeChild(
this.lookerElement.element
);
this.lookerElement.element.parentElement.removeChild(
this.lookerElement.element
);
this.updater({ destroyed: true });
}
disable() {
Expand Down
2 changes: 1 addition & 1 deletion app/packages/state/src/hooks/useSetExpandedSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default () => {
[]
);

const commit = useRecoilCallback(
return useRecoilCallback(
({ set }) =>
async (selector: ModalSelector) => {
set(modalSelector, selector);
Expand Down

0 comments on commit a9f95e5

Please sign in to comment.