Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,6 @@ public void onClick(View v) {
}
break;
case RequestCodes.CREATE_SITE:
passOnActivityResultToMySiteFragment(requestCode, resultCode, data);
QuickStartUtils.cancelQuickStartReminder(this);
AppPrefs.setQuickStartNoticeRequired(false);
AppPrefs.setLastSkippedQuickStartTask(null);
Expand Down Expand Up @@ -1096,7 +1095,6 @@ public void onClick(View v) {
}
break;
case RequestCodes.SITE_PICKER:
passOnActivityResultToMySiteFragment(requestCode, resultCode, data);
if (getMySiteFragment() != null) {
boolean isSameSiteSelected = data != null
&& data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1) == AppPrefs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,11 @@ class ImprovedMySiteFragment : Fragment(),
viewModel.handleSuccessfulDomainRegistrationResult(data.getStringExtra(RESULT_REGISTERED_DOMAIN_EMAIL))
}
RequestCodes.CREATE_SITE -> {
viewModel.startQuickStart()
viewModel.startQuickStart(data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1))
}
RequestCodes.SITE_PICKER -> {
if (data.getIntExtra(WPMainActivity.ARG_CREATE_SITE, 0) == RequestCodes.CREATE_SITE) {
viewModel.startQuickStart()
viewModel.startQuickStart(data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ class MySiteViewModel
}
}

fun startQuickStart() {
quickStartRepository.startQuickStart()
fun startQuickStart(newSiteLocalID: Int) {
quickStartRepository.startQuickStart(newSiteLocalID)
}

fun onQuickStartMenuInteraction(interaction: DynamicCardMenuInteraction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ class QuickStartRepository
}
}

fun startQuickStart() {
selectedSiteRepository.getSelectedSite()?.let { site ->
quickStartStore.setDoneTask(site.id.toLong(), CREATE_SITE, true)
fun startQuickStart(newSiteLocalID: Int) {
if (newSiteLocalID != -1) {
quickStartStore.setDoneTask(newSiteLocalID.toLong(), CREATE_SITE, true)
refresh()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ class QuickStartRepositoryTest : BaseUnitTest() {

@Test
fun `start marks CREATE_SITE as done and loads model`() = test {
whenever(selectedSiteRepository.getSelectedSite()).thenReturn(site)
initStore()

quickStartRepository.startQuickStart()
quickStartRepository.startQuickStart(siteId)

verify(quickStartStore).setDoneTask(siteId.toLong(), CREATE_SITE, true)
assertModel()
Expand Down