@ -17,44 +17,44 @@ import { persistStore } from "redux-persist";
import { setFilteredSubscriptions } from "./state/features/videoSlice.ts" ;
import { SubscriptionObject } from "./state/features/persistSlice.ts" ;
function App() {
// const themeColor = window._qdnTheme
export const getUserName = async ( ) = > {
const account = await qortalRequest ( {
action : "GET_USER_ACCOUNT" ,
} ) ;
const nameData = await qortalRequest ( {
action : "GET_ACCOUNT_NAMES" ,
address : account.address ,
} ) ;
const [ theme , setTheme ] = useState ( "dark" ) ;
let persistor = persistStore ( store ) ;
if ( nameData ? . length > 0 ) return nameData [ 0 ] . name ;
else return "" ;
} ;
const filterVideosByName = (
subscriptionList : SubscriptionObject [ ] ,
userName : string
) = > {
return subscriptionList . filter ( item = > {
return item . userName === userName ;
} ) ;
} ;
export const filterVideosByName = (
subscriptionList : SubscriptionObject [ ] ,
userName : string
) = > {
return subscriptionList . filter ( item = > {
return item . userName === userName ;
} ) ;
} ;
const getUserName = async ( ) = > {
const account = await qortalRequest ( {
action : "GET_USER_ACCOUNT" ,
} ) ;
const nameData = await qortalRequest ( {
action : "GET_ACCOUNT_NAMES" ,
address : account.address ,
} ) ;
export const subscriptionListFilter = async ( ) = > {
const subscriptionList = store . getState ( ) . persist . subscriptionList ;
const filterByUserName =
store . getState ( ) . persist . subscriptionListFilter === "currentNameOnly" ;
const userName = await getUserName ( ) ;
if ( nameData ? . length > 0 ) return nameData [ 0 ] . name ;
else return "" ;
} ;
if ( filterByUserName && userName ) {
return filterVideosByName ( subscriptionList , userName ) ;
} else return subscriptionList ;
} ;
const subscriptionListFilter = async ( ) = > {
const subscriptionList = store . getState ( ) . persist . subscriptionList ;
const filterByUserName =
store . getState ( ) . persist . subscriptionListFilter === "currentNameOnly" ;
const userName = await getUserName ( ) ;
function App() {
// const themeColor = window._qdnTheme
if ( filterByUserName && userName ) {
return filterVideosByName ( subscriptionList , userName ) ;
} else return subscriptionList ;
} ;
const [ theme , setTheme ] = useState ( "dark" ) ;
let persistor = persistStore ( store ) ;
useEffect ( ( ) = > {
const subscriptionList = store . getState ( ) . persist . subscriptionList ;