Skip to content

Commit

Permalink
feat: return lang from member and item in app item (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia authored Feb 22, 2023
1 parent b30662e commit 5608bf0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/items/AppItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Skeleton from '@mui/material/Skeleton';

import React, { Component } from 'react';

import { UUID, getAppExtra } from '@graasp/sdk';
import { DEFAULT_LANG, UUID, getAppExtra } from '@graasp/sdk';
import { AppItemTypeRecord, MemberRecord } from '@graasp/sdk/frontend';

import {
Expand Down Expand Up @@ -62,7 +62,6 @@ export interface AppItemProps {
* whether manual resize is enabled (as opposed to automatic resize, default)
*/
isResizable?: boolean;
lang?: string;
/**
* Id of the current member used for saving the resizing preferences
*/
Expand Down Expand Up @@ -205,8 +204,7 @@ export class AppItem extends Component<AppItemProps> {
};

windowOnMessage = (e: MessageEvent): void => {
const { item, member, memberId, apiHost, lang, context, permission } =
this.props;
const { item, member, memberId, apiHost, context, permission } = this.props;
const { url } = this.state;
const { data, origin: requestOrigin } = e;

Expand Down Expand Up @@ -239,7 +237,7 @@ export class AppItem extends Component<AppItemProps> {
settings: item.settings,
memberId: memberId || member?.id,
permission,
lang,
lang: item.settings?.lang || member?.extra?.lang || DEFAULT_LANG,
context,
},
}),
Expand Down

0 comments on commit 5608bf0

Please sign in to comment.