Connect2IC / connect2ic

https://connect2ic.github.io/docs/
MIT License
92 stars 19 forks source link

Actor uses anonymous prinicpal whenever called in UseEffect react #29

Open alejandrade opened 1 year ago

alejandrade commented 1 year ago

Code

    const [_factoryActor] = useCanister('factory', { mode: 'connected' });
    const factoryActor = _factoryActor as unknown as FACTORY_SERVICE;
    useEffect(() => {
        init();
    }, []);

    async function init() {
        const versions = await factoryActor.getRegistrationCost();
        setRegistrationCost(versions);
    }

I checked the principal before it calls and it's my wallet principal but once it reaches the canister, it's the anonymous principal.