Skip to content

Commit

Permalink
fix: aside menu bottom maid sticky. tg -> ton_proof Auth fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Mar 12, 2024
1 parent 3aabacd commit a2bdd2e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const WideLayout = styled.div`
display: flex;
& > *:first-child {
width: 200px;
width: 250px;
}
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/entries/pro.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface ProState {
wallet: ProStateWallet;
hasCookie: boolean;
hasWalletAuthCookie: boolean;
subscription: ProSubscription;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/service/proService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const getProState = async (storage: IStorage, wallet: WalletState): Promi
} catch (e) {
return {
subscription: toEmptySubscription(),
hasCookie: false,
hasWalletAuthCookie: false,
wallet: {
publicKey: wallet.publicKey,
rawAddress: wallet.active.rawAddress
Expand Down Expand Up @@ -115,7 +115,7 @@ export const loadProState = async (

return {
subscription,
hasCookie: true,
hasWalletAuthCookie: !!user.pub_key,
wallet
};
};
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tonConsoleApi/services/ProServiceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export class ProServiceService {
* @throws ApiError
*/
public static proServiceGetUserInfo(): CancelablePromise<{
pub_key: string;
version: string;
pub_key?: string;
version?: string;
user_id?: number;
tg_id?: number;
}> {
Expand Down
8 changes: 7 additions & 1 deletion packages/uikit/src/components/aside/AsideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const AsideContainer = styled.div`
background: ${p => p.theme.backgroundContent};
display: flex;
flex-direction: column;
padding: 0.5rem;
padding: 0.5rem 0.5rem 0;
`;

const IconWrapper = styled.div`
Expand All @@ -40,6 +40,7 @@ const AsideMenuCard = styled.button<{ isSelected: boolean }>`
padding: 6px 10px;
width: 100%;
height: 36px;
min-height: 36px;
display: flex;
align-items: center;
gap: 10px;
Expand All @@ -65,6 +66,11 @@ const AsideMenuBottom = styled.div`
display: flex;
flex-direction: column;
justify-content: flex-end;
position: sticky;
bottom: 0;
background: ${p => p.theme.backgroundContent};
padding: 0.5rem 0;
`;

export const AsideMenuAccount: FC<{ publicKey: string; isSelected: boolean }> = ({
Expand Down
2 changes: 1 addition & 1 deletion packages/uikit/src/components/aside/SubscriptionInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const SubscriptionStatus: FC<{ data: ProState }> = ({ data }) => {
export const SubscriptionInfo: FC<{ className?: string }> = ({ className }) => {
const { data } = useProState();

if (!data) {
if (!data || !data.subscription.valid) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/uikit/src/components/dashboard/DashboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const DashboardTable: FC<{ className?: string }> = ({ className }) => {
const { data: dashboardData } = useDashboardData();
const { data: wallets, isFetched: isWalletsFetched } = useWalletsState();
const mainnetPubkeys = wallets
?.filter(w => w?.network === Network.MAINNET)
?.filter(w => w && w.network !== Network.TESTNET)
.map(w => w!.publicKey);

const [isResizing, setIsResizing] = useState<boolean>(false);
Expand Down
2 changes: 1 addition & 1 deletion packages/uikit/src/components/settings/ProSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ const PreServiceStatus: FC<{ data: ProState; setReLogin: () => void }> = ({
const ProContent: FC<{ data: ProState }> = ({ data }) => {
const [reLogin, setReLogin] = useState(false);

if (!data.hasCookie || reLogin) {
if (!data.hasWalletAuthCookie || reLogin) {
return <SelectWallet />;
}
if (isPaidSubscription(data.subscription)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/uikit/src/state/dashboard/useDashboardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function useDashboardData() {
const client = useQueryClient();

const { data: walletsState } = useWalletsState();
const mainnetWallets = walletsState?.filter(w => w?.network === Network.MAINNET);
const mainnetWallets = walletsState?.filter(w => w && w.network !== Network.TESTNET);
const publicKeysMainnet = mainnetWallets?.map(w => w!.publicKey);

return useQuery<DashboardCell[][]>(
Expand Down

0 comments on commit a2bdd2e

Please sign in to comment.