@@ -21,14 +21,14 @@ const { handleError } = injectNotificationManager()
2121const client = injectModrinthClient ()
2222
2323const supportsEnvironment = computed (() =>
24- projectV3 .value .project_types .some ((type ) => [' mod' , ' modpack' ].includes (type )),
24+ ( projectV3 .value ? .project_types ?? []) .some ((type ) => [' mod' , ' modpack' ].includes (type )),
2525)
2626
2727const needsToVerify = computed (
2828 () =>
29- projectV3 .value .side_types_migration_review_status === ' pending' &&
30- (projectV3 .value .environment ?.length ?? 0 ) > 0 &&
31- projectV3 .value .environment ?.[0 ] !== ' unknown' &&
29+ projectV3 .value ? .side_types_migration_review_status === ' pending' &&
30+ (projectV3 .value ? .environment ?.length ?? 0 ) > 0 &&
31+ projectV3 .value ? .environment ?.[0 ] !== ' unknown' &&
3232 supportsEnvironment .value ,
3333)
3434
@@ -38,13 +38,14 @@ const hasPermission = computed(() => {
3838})
3939
4040function getInitialEnv() {
41- return projectV3 .value .environment ?.length === 1 ? projectV3 .value .environment [0 ] : undefined
41+ const env = projectV3 .value ?.environment
42+ return env ?.length === 1 ? env [0 ] : undefined
4243}
4344
4445const { saved, current, saving, reset, save } = useSavable (
4546 () => ({
4647 environment: getInitialEnv (),
47- side_types_migration_review_status: projectV3 .value .side_types_migration_review_status ,
48+ side_types_migration_review_status: projectV3 .value ? .side_types_migration_review_status ,
4849 }),
4950 async ({ environment }) => {
5051 try {
@@ -130,7 +131,7 @@ const messages = defineMessages({
130131 />
131132 <Admonition
132133 v-else-if ="
133- !projectV3.environment ||
134+ !projectV3? .environment ||
134135 projectV3.environment.length === 0 ||
135136 (projectV3.environment.length === 1 && projectV3.environment[0] === 'unknown')
136137 "
@@ -140,7 +141,7 @@ const messages = defineMessages({
140141 class =" mb-3"
141142 />
142143 <Admonition
143- v-else-if =" projectV3.environment.length > 1"
144+ v-else-if =" ( projectV3? .environment? .length ?? 0) > 1"
144145 type =" info"
145146 :header =" formatMessage(messages.multipleEnvironmentsTitle)"
146147 :body =" formatMessage(messages.multipleEnvironmentsDescription)"
0 commit comments