Moved to global image source manager to allow resource sharing

This commit is contained in:
Mitchell McCaffrey
2021-03-12 17:35:26 +11:00
parent b6c6d9b553
commit 5231d14937
11 changed files with 231 additions and 110 deletions

View File

@@ -2,7 +2,7 @@ import React from "react";
import Tile from "../Tile";
import useDataSource from "../../hooks/useDataSource";
import { useImageSource } from "../../contexts/ImageSourceContext";
import { mapSources as defaultMapSources, unknownSource } from "../../maps";
function MapTile({
@@ -15,11 +15,11 @@ function MapTile({
canEdit,
badges,
}) {
const isDefault = map.type === "default";
const mapSource = useDataSource(
isDefault ? map : map.thumbnail,
const mapSource = useImageSource(
map,
defaultMapSources,
unknownSource
unknownSource,
map.type === "file"
);
return (