Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge] #839

Closed
wants to merge 10 commits into from
5 changes: 3 additions & 2 deletions src/commonComponents/QRcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import domtoimage from 'dom-to-image';

const CustomQRCode = ({ value, size }: { value: string, size: number }) => {

const inputRef = useRef<HTMLInputElement>(null);
const node = document.createTextNode('');
const inputRef = useRef<Node>(node);
const [isCopied, setIsCopied] = useState(false);

function copyTextVal(e: React.MouseEvent<HTMLButtonElement>) {
Expand All @@ -24,7 +25,7 @@ const CustomQRCode = ({ value, size }: { value: string, size: number }) => {
}

const drawHtmlToCanvas = () => {
domtoimage.toJpeg(inputRef.current, { quality: 0.95 })
domtoimage.toJpeg(inputRef.current, { quality: 0.95 })
.then(function (dataUrl) {
var link = document.createElement('a');
link.download = 'my-image-name.jpeg';
Expand Down
17 changes: 9 additions & 8 deletions src/components/Issuance/IssuedCrdentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ const CredentialList = () => {
const response = await getOrganizationById(orgId);
const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const did = data?.data?.org_agents?.[0]?.orgDid;

await setToLocalStorage(storageKeys.ORG_DID, did)
if (did.includes(DidMethod.POLYGON) || did.includes(DidMethod.KEY) || did.includes(DidMethod.WEB)) {
setW3CSchema(true);
}
if (did.includes(DidMethod.INDY)) {
setW3CSchema(false);
const did = data?.data?.org_agents[0]?.orgDid;
if (did) {
await setToLocalStorage(storageKeys.ORG_DID, did)
if (did.includes(DidMethod.POLYGON) || did.includes(DidMethod.KEY) || did.includes(DidMethod.WEB)) {
setW3CSchema(true);
}
if (did.includes(DidMethod.INDY)) {
setW3CSchema(false);
}
}
}
setLoading(false);
Expand Down
7 changes: 5 additions & 2 deletions src/components/Profile/DisplayProfileImg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ const DisplayProfileImg = () => {
const userProfile = await getFromLocalStorage(storageKeys.USER_PROFILE)
const orgRoles = await getFromLocalStorage(storageKeys.ORG_ROLES)
const parsedUser = userProfile ? JSON.parse(userProfile) : null;
parsedUser.roles = orgRoles
setUserObj(parsedUser)

if (parsedUser) {
parsedUser.roles = orgRoles;
setUserObj(parsedUser);
}
}

useEffect(() => {
Expand Down
11 changes: 7 additions & 4 deletions src/components/Profile/DisplayUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ const DisplayUser = () => {
const userProfile = await getFromLocalStorage(storageKeys.USER_PROFILE)
const orgRoles = await getFromLocalStorage(storageKeys.ORG_ROLES)
const parsedUser = userProfile ? JSON.parse(userProfile) : null
parsedUser.roles = orgRoles
setUserObj(parsedUser)

if (parsedUser) {
parsedUser.roles = orgRoles;
setUserObj(parsedUser);
}
}
useEffect(() => {
const fetchData = async () => {
Expand All @@ -39,10 +42,10 @@ const DisplayUser = () => {
className="text-xl font-medium text-gray-900 truncate dark:text-gray-300 mb-1"
role="none"
>
{userObj['firstName']}
{userObj?.['firstName']}
</p>
<p className="text-sm text-gray-900 dark:text-white mb-1" role="none">
{userObj['email']}
{userObj?.['email']}
</p>
<p
className="text-base font-medium text-gray-900 truncate dark:text-gray-300"
Expand Down
12 changes: 7 additions & 5 deletions src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,17 @@ const UserDashBoard = () => {
const response = await getOrganizationById(orgId);
const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const orgDid = data?.data?.org_agents[0].orgDid
if (data?.data?.org_agents) {
const orgAgentsList = data?.data?.org_agents;
if (orgAgentsList && orgAgentsList.length > 0) {
const orgDid = orgAgentsList[0].orgDid;
setWalletData(data?.data?.org_agents);

if(orgDid?.includes(DidMethod.INDY)){
setIsW3C(false);
}
} else {
setWalletData([]);
}
if(orgDid.includes(DidMethod.INDY)){
setIsW3C(false);
}
}
setWalletLoading(false);
};
Expand Down
Loading