aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-06-20 09:30:54 -0400
committerbobzel <zzzman@gmail.com>2025-06-20 09:30:54 -0400
commite7a96fa043cfc9c3c426e09bbef42c8df88a45f6 (patch)
treefa133de33383f090ff430a29c6720e11ff3385bd /src/client/views/nodes/ImageBox.tsx
parent21fb3a555cdd861452e2e54de3d0524e29f2bc08 (diff)
cleanup
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r--src/client/views/nodes/ImageBox.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 5b738ee19..78bacdcac 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -72,7 +72,7 @@ export class ImageEditorData {
public static set AddDoc(addDoc: Opt<(doc: Doc | Doc[], annotationKey?: string) => boolean>) { ImageEditorData.set(this.imageData.open, this.imageData.rootDoc, this.imageData.source, addDoc); } // prettier-ignore
}
-const API_URL = 'https://api.unsplash.com/search/photos';
+const UNSPLASH_API = 'https://api.unsplash.com/search/photos';
@observer
export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
public static LayoutString(fieldKey: string) {
@@ -245,7 +245,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
*/
fetchImages = async () => {
try {
- const { data } = await axios.get(`${API_URL}?query=${this._searchInput}&page=1&per_page=${1}&client_id=${process.env.VITE_API_KEY}`);
+ const { data } = await axios.get(`${UNSPLASH_API}?query=${this._searchInput}&page=1&per_page=${1}&client_id=${process.env.VITE_API_KEY}`);
const imageSnapshot = Docs.Create.ImageDocument(data.results[0].urls.small, {
_nativeWidth: Doc.NativeWidth(this.layoutDoc),
_nativeHeight: Doc.NativeHeight(this.layoutDoc),
@@ -262,8 +262,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
}
};
- handleSelection = (selection: string) => (this._searchInput = selection);
-
drop = undoable(
action((e: Event, de: DragManager.DropEvent) => {
if (de.complete.docDragData && !this._props.rejectDrop?.(de, this.DocumentView?.())) {