[ SYSTEM ]: Linux wordpress 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
blocks
/
shared
/
presets
/
parts
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 ChooseProvider.js
3,993 B
SET
[ EDIT ]
|
[ DEL ]
📄 FluentCRMConfig.js
2,823 B
SET
[ EDIT ]
|
[ DEL ]
📄 MailerLiteConfig.js
1,579 B
SET
[ EDIT ]
|
[ DEL ]
📄 YoutubeChannelId.js
2,380 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: FluentCRMConfig.js
/** * WordPress dependencies */ const { __ } = wp.i18n; const { SelectControl, Notice } = wp.components; const { useEffect, useState } = wp.element; import LoadSelect from "../../components/LoadSelect"; export default ({ options, updateEmailState }) => { const [fetchingLists, setFetchingLists] = useState(false); const [fetchingTags, setFetchingTags] = useState(false); const [lists, setLists] = useState([ { value: null, label: __("Choose a list", "presto-player") }, ]); const [tags, setTags] = useState([ { value: null, label: __("Choose a tag", "presto-player") }, ]); const [error, setError] = useState(""); const fetchLists = async () => { setFetchingLists(true); try { const fetched = await wp.apiFetch({ path: "presto-player/v1/fluentcrm/lists", }); let listOptions = lists; (fetched || []).forEach((list) => { listOptions = [ ...listOptions, ...[ { value: list.id, label: list.title || list.slug, }, ], ]; }); setLists(listOptions); } catch (e) { if (e?.message) { setError(e.message); } } finally { setFetchingLists(false); } }; const fetchTags = async () => { setFetchingTags(true); try { const fetched = await wp.apiFetch({ path: "presto-player/v1/fluentcrm/tags", }); let tagOptions = tags; (fetched || []).forEach((tag) => { tagOptions = [ ...tagOptions, ...[ { value: tag.id, label: tag.title || tag.slug, }, ], ]; }); setTags(tagOptions); } catch (e) { if (e?.message) { setError(e.message); } } finally { setFetchingTags(false); } }; useEffect(() => { fetchLists(); fetchTags(); }, []); if (error) { return ( <Notice className="presto-notice" status="error" isDismissible={false}> {error} </Notice> ); } return ( <div> {fetchingLists ? ( <LoadSelect /> ) : ( lists.length > 1 && ( <SelectControl label={__("Choose a list", "presto-player")} value={options?.provider_list} options={lists} onChange={(provider_list) => updateEmailState({ provider_list })} /> ) )} {fetchingTags ? ( <LoadSelect /> ) : ( tags.length > 1 && ( <SelectControl label={__("Choose a tag", "presto-player")} value={options?.provider_tag} options={tags} onChange={(provider_tag) => updateEmailState({ provider_tag })} /> ) )} </div> ); };