Skip to content

Commit

Permalink
fix(article): fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
WaDadidou committed Dec 12, 2024
1 parent b6ec92f commit a8cab39
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/components/navigation/getNormalModeScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CoreDAOScreen } from "@/screens/CoreDAO/CoreDAOScreen";
import { DAppStoreScreen } from "@/screens/DAppStore/DAppStoreScreen";
import { ToriPunks } from "@/screens/DAppStore/apps/toripunks/HomeScreen";
import { FeedScreen } from "@/screens/Feed/FeedScreen";
import { FeedNewArticleScreen } from "@/screens/FeedNewArticle/FeedNewArticleScreen.tsx";
import { FeedNewArticleScreen } from "@/screens/FeedNewArticle/FeedNewArticleScreen";
import { FeedPostViewScreen } from "@/screens/FeedPostView/FeedPostViewScreen";
import { GovernanceProposalScreen } from "@/screens/Governance/GovernanceProposal/GovernanceProposalScreen";
import { GovernanceScreen } from "@/screens/Governance/GovernanceScreen";
Expand Down
18 changes: 11 additions & 7 deletions packages/screens/FeedNewArticle/FeedNewArticleScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { ArticleContentEditor } from "@/screens/FeedNewArticle/components/Articl
import { NewArticleLocationButton } from "@/screens/FeedNewArticle/components/NewArticleLocationButton";
import { selectNFTStorageAPI } from "@/store/slices/settings";
import { feedPostingStep, FeedPostingStepId } from "@/utils/feed/posting";
import { generateArticleMetadata } from "@/utils/feed/queries";
import { generateIpfsKey } from "@/utils/ipfs";
import { IMAGE_MIME_TYPES } from "@/utils/mime";
import { ScreenFC, useAppNavigation } from "@/utils/navigation";
Expand Down Expand Up @@ -129,6 +130,8 @@ export const FeedNewArticleScreen: ScreenFC<"FeedNewArticle"> = () => {
mentions: [],
};

const navigateBack = () => navigation.navigate("Feed");

const onPublish = async () => {
const action = "Publish an Article";
if (!wallet?.address || !wallet.connected) {
Expand Down Expand Up @@ -177,15 +180,16 @@ export const FeedNewArticleScreen: ScreenFC<"FeedNewArticle"> = () => {
)[0]
: undefined;

const metadata: SocialFeedArticleMetadata = {
const metadata = generateArticleMetadata({
...formValues,
thumbnailImage: remoteThumbnail,
title: formValues.title,
shortDescription: formValues.shortDescription || "",
gifs: [],
files: [],
mentions: [],
hashtags: [],
message: formValues.message,
location,
hashtags: [],
mentions: [],
};
});

await makePost(JSON.stringify(metadata));
} catch (err) {
Expand All @@ -208,7 +212,7 @@ export const FeedNewArticleScreen: ScreenFC<"FeedNewArticle"> = () => {
mobileTitle="NEW ARTICLE"
fullWidth
headerChildren={<BrandText style={fontSemibold20}>New Article</BrandText>}
onBackPress={() => navigation.navigate("Feed")}
onBackPress={navigateBack}
footerChildren
noMargin
noScroll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const FeedPostArticleMarkdownView: FC<{
isNextPageAvailable.value = hasNextPage;
}, [hasNextPage, isNextPageAvailable]);

if (!articleMetadata) return null;
if (!articleMetadata || !message) return null;
return (
<ScreenContainer
forceNetworkId={post.networkId}
Expand Down

0 comments on commit a8cab39

Please sign in to comment.