@@ -110,14 +110,11 @@ private HSSource(Context context) {
110
110
111
111
cachedTicket = new HSCachedTicket ();
112
112
cachedUser = new HSCachedUser ();
113
+ draftObject = new HSDraft ();
113
114
114
- // read the ticket data from cache and maintain here
115
- doReadTicketsFromCache ();
116
- doReadUserFromCache ();
117
- doReadDraftFromCache ();
115
+ refreshFieldsFromCache ();
118
116
}
119
117
120
-
121
118
122
119
public void requestKBArticle (String cancelTag , HSKBItem section , OnFetchedArraySuccessListener success , ErrorListener errorListener ) {
123
120
@@ -367,6 +364,13 @@ public void cancelOperation(String cancelTag) {
367
364
//////// Utility Functions /////////////////
368
365
/////////////////////////////////////////////////
369
366
367
+ public void refreshFieldsFromCache () {
368
+ // read the ticket data from cache and maintain here
369
+ doReadTicketsFromCache ();
370
+ doReadUserFromCache ();
371
+ doReadDraftFromCache ();
372
+ }
373
+
370
374
/**
371
375
* Opens a file and read its content. Return null if any error occured or file not found
372
376
* @param file
@@ -483,10 +487,6 @@ protected void doReadDraftFromCache() {
483
487
}
484
488
485
489
protected void doSaveTicketDraftForGearInCache (String subject , String message , HSAttachment [] attachmentsArray ) {
486
- if (draftObject == null ) {
487
- draftObject = new HSDraft ();
488
- }
489
-
490
490
draftObject .setDraftSubject (subject );
491
491
draftObject .setDraftMessage (message );
492
492
draftObject .setDraftAttachments (attachmentsArray );
0 commit comments