mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 18:42:10 +00:00
list media objects set to session user name
This commit is contained in:
1 parent
6aaac0170d
commit
01ea0b980d
1 file changed
+5
-2
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useContext, useState, useEffect } from "react";
|
||||
import { AssetFilterOption, AssetType } from "~/pages/PageEnigma/models";
|
||||
import { useSignals } from "@preact/signals-react/runtime";
|
||||
import {
|
||||
@@ -15,6 +15,7 @@ import { shapeItems } from "~/pages/PageEnigma/store";
|
||||
import { GetMediaByUser, GetMediaListResponse } from "~/api/media_files/GetMediaByUser";
|
||||
import { AssetFilterOption, MediaItem } from "~/pages/PageEnigma/models";
|
||||
import { BucketConfig } from "~/api/BucketConfig";
|
||||
import { AuthenticationContext } from "~/contexts/Authentication/AuthenticationContext/";
|
||||
|
||||
interface Props {
|
||||
type: AssetType;
|
||||
@@ -39,12 +40,14 @@ export const ObjectsTab = ({ type }: Props) => {
|
||||
}]
|
||||
});
|
||||
|
||||
const { authState } = useContext(AuthenticationContext);
|
||||
|
||||
const [status,statusSet] = useState(FetchStatus.ready);
|
||||
|
||||
useEffect(() => {
|
||||
if (status === FetchStatus.ready && type !== AssetType.CHARACTER) {
|
||||
statusSet(FetchStatus.in_progress);
|
||||
GetMediaByUser("echelon",{},{
|
||||
GetMediaByUser(authState.userInfo.username,{},{
|
||||
filter_media_type: "glb"
|
||||
})
|
||||
.then((res: GetMediaListResponse) => {
|
||||
|
||||
Reference in new issue
Block a user